Main Content

Search Model Contents

You can use the Finder to search a Simulink® model, subsystem, or library or a Stateflow® chart for model elements such as blocks and signal lines. For example, you can search for a specific block, or you can search for all the Constant blocks in the model. You can also search for parameters, functions, annotations, events, or messages.

You can narrow your search by filtering the search results.

Tip

If you want to filter the model content inventory for items of a certain type or with certain properties, you can also use the Model Data Editor.

To search for the source or destination of a signal and trace signal paths, see Highlight Signal Sources and Destinations.

If your model contains blocks that connect without signal lines, given one such block, you can highlight or jump to the blocks it connects to. For more information, see Search for Blocks Connected Without Signal Lines.

To search for Simulink Editor actions, see Keyword Search for Simulink Editor Actions.

Keyword Search for Model Elements and Parameters

You can use the Finder to perform a keyword search for model elements and parameters.

To open the Finder, select the Simulink Editor and press Ctrl+F.

In the search box, type a keyword or key phrase, then press Enter. The keyword or key phrase can be any in this table.

Keyword or Key PhraseExample
Name of an itemA block name or a signal line label
Type of itemsignal or subsystem
Property valueName of a variable used to set the Constant value of a Constant block
Label stringCondition of a Stateflow transition
Words or phrases in a scriptLine of code in a MATLAB Function block
Words or phrases in a descriptionPhrase from a block description
Name of a sourceFor a signal line, the block to whose input port the signal line connects
Name of a destinationFor a signal line, the block to whose output port the signal line connects

The search results highlight matches for the keyword or key phrase in the Names column.

To navigate to a search result in the model, in the Finder, in the Name column, double-click the item.

The video show the Finder open in the sldemo_fuelsys. The search box contains the key phrase throttle transient. The pointer clicks the Find button next to the search field. The search results table populates. The pointer double-clicks a highlighted search result in the Name column. The search result is the name of a block. The subsystem containing the block opens. The block is highlighted in the canvas.

To change the scope of the search, click Change the search scope and select one of these options:

  • Search from top model

  • Search this level and below

  • Search this level only

When a search returns too many results, narrow your search using advanced settings . For more information, see Perform Advanced Search.

You can also use the Finder to replace text in the model. For more information, see Find and Replace Text.

Search for Blocks Connected Without Signal Lines

Related blocks connect without signal lines. To search for related blocks, select a block. All blocks related to the selected block highlight in purple. Blocks that contain related blocks also highlight in purple.

To both find and switch selection to a related block, you can use the Related Blocks button.

Note

The Related Blocks button is not available for blocks from the Dashboard, Customizable Blocks, or Aerospace Blockset™ libraries.

Select a block, then pause on the ellipsis (…) that appears. In the action bar that expands, click Related Blocks . If more than one related block is present, a list of related blocks appears. Navigate to the name of the block you want to select by clicking or using the arrow keys on your keyboard, then press Enter.

Tip

Instead of the Related Blocks button in the action bar, you can also click the Related Blocks button in the Simulink Toolstrip, on the block-specific tab (for example, the Goto tab of a Goto block).

When you switch the selection, you automatically navigate to the related block that you are switching the selection to. If the block you switch the selection to is located inside a component (for example, a subsystem or model reference), and the selected block is not inside a component or is inside a different component, the component you automatically navigate to opens in a new tab or a new window.

The model contains an Initialize Function, a Reset Function, and a Terminate Function block. When the pointer selects the Discrete Integrator block, the three function blocks highlight in purple. The pointer pauses on the ellipsis that hovers above the Discrete Integrator block. The action bar expands. The pointer clicks the Related Blocks button. A list of related blocks appears. The pointer selects the State Reader block. The Terminate Function block opens, and the State Reader block highlights in blue.

See Also

|

Related Topics