Filter Objects in the Model Explorer

Controlling the Set of Objects to Display

Two techniques that you can use to control the set of objects that the Contents pane displays are:

  • Using the Row Filter option

  • Filtering contents

For a summary of other techniques, see Focusing on Specific Elements of a Model or Chart.

Using the Row Filter Option

You can filter the kinds of objects that the Contents pane displays:

  1. Open the Row Filter options menu. In the Model Explorer, at the top-right corner of the Contents pane, click the Row Filter button.

    An alternative way to open the Row Filter menu is to select View > Row Filter.

    By default, the Contents pane displays these kinds of objects for the selected node:

    • Blocks

    • Signals and connections

    • Stateflow® states, functions, and boxes

    • Stateflow events

    • Stateflow data

  2. Clear the kinds of objects that you do not want to display in the Contents pane, or enable any cleared options to display more kinds of objects. For example, clear All Signals/Connections to prevent the display of signal and connection objects in the Contents pane.

Object Count

The top-right portion of the Contents pane includes an object counter, indicating how many objects the Contents pane is displaying.

When you use the Row Filter option to filter objects, the object count indicator reflects that the Contents pane displays a subset of all the model and chart objects.

To view an explanation of the current object count, click the object count link (for example, 12 of 25 objects). That link displays a pop-up information box:

Filtering Contents

To refine the display of objects that are currently displayed in the Contents pane, you can use the Filter Contents text box at the top of the Contents pane to specify search strings for filtering a subset of objects.

Using the Filter Contents text box can help you to find specific objects within the set of objects, based on a particular object name, property value, or property that is of interest to you. For example, if you enter the text string fuel in the Filter Contents edit box, the Model Explorer displays results similar to those shown above. The results highlight the text string that you specified.

Specifying Filter Text Strings

As you enter text in the Filter Contents text box, the Model Explorer performs a dynamic search, displaying results that reflect the text as you enter it.

The text strings you enter must be in the format consistent with the guidelines described in the following sections.

Case Sensitivity.  By default, the Model Explorer ignores case as it performs the filtering.

To specify that you want the Model Explorer to respect case sensitivity for a text string that you enter, put that text string in quotation marks. For example, if you want to restrict the filtering to display only objects that include the text Fuel (with a capital F), enter "Fuel" (with quotation marks).

Specifying Properties and Property Values.  To restrict the filtering to apply to objects with a specific property, specify the property name followed by a colon (:). The Contents pane displays objects that have that property.

To filter for a objects for which a specific property has a specific value, specify the property name followed by a colon (:) and then the value. For example, to filter the contents to display only objects whose OutDataTypeStr property has a value that includes Inherit, enter OutDataTypeStr: Inherit (alternatively, you could put the whole string in quotation marks to enforce case sensitivity):

Wildcards and MATLAB Expressions Not Supported.  The Model Explorer does not recognize wildcard characters, such as an asterisk (*), as having any special meaning. For example, if you enter fuel* in the Filter Contents text box, you get no results, even if several objects contain the text string fuel.

Also, if you specify a MATLAB® expression, in the Filter Contents text box, the Model Explorer interprets that string as literal text, not as a MATLAB expression.

Clearing the Filtered Contents

To redisplay the object property table as it appeared before you filtered the contents, click the X in the Filter Contents text box.

Filtering Removes Grouping

If you have set up grouping on a column, then when you filtering contents, the Model Explorer does not retain that grouping.

Was this topic helpful?