Use the Model Explorer to view, modify, and add elements of Simulink® models, Stateflow® charts, and workspace variables. The Model Explorer lets you focus on specific elements (for example, blocks, signals, and properties) without navigating through the model or chart.
Use the Model Explorer to search for:
Variables in workspaces and data dictionaries
Variable usage in a model
Instances of a type of block
Block parameters and parameter values
You can combine search criteria and iteratively refine the results. Search in Model Explorer for model elements, starting with the node you select in the model hierarchy. You can search the entire model, in a particular system, or in a system and all the systems below it in the hierarchy. For details on the options, see Search Bar Controls.
For an example showing how to search for a parameter, see Search Using Model Explorer.
Using your search results, you can apply changes to multiple elements at once.
To manipulate model data (block parameters, signals, and states) in a searchable, sortable table, consider using the Model Data Editor. You can specify data attributes such as parameter values, signal names, and initial values for states. See Configure Data Properties by Using the Model Data Editor.
To create, modify, and view the entries in a data dictionary, use the Model Explorer. See Edit and Manage Workspace Variables by Using Model Explorer and View and Revert Changes to Dictionary Data.
To open the Model Explorer, use one of these approaches:
From the Simulink Editor Modeling tab, click Model Explorer.
In an open model in the Simulink Editor, right-click a block and from the context menu, select Explore.
In an open Stateflow chart, right-click in the drawing area and from the context menu, select Explore.
At the MATLAB® command line, enter
Use this workflow to view and edit object properties:
To specify whether to display only the current system or the whole system hierarchy, select the model in the Model Hierarchy pane.
Control the model information the Contents pane displays:
Control which property columns to display using the View > Column View option.
Control which types of objects to display using the View > Row Filter option.
Directly manipulate column headings
Identify model elements with specific values using the search bar.
Edit the values for model elements, in either the Contents pane or the Dialog pane. To edit workspace variables, you can use the Variable Editor.
Open the search bar using the View > Toolbars > Search Bar option. The search bar includes these controls:
Use the Search Type control to specify the type of objects or properties to include in the search.
|Search Type Option||Description|
|Searches a model or chart for all objects that have the specified string in the name of the object. See Search Strings.|
|Searches for objects that have a specified property. Specify the target property name from a list of properties that objects in the search domain can have.|
Searches for objects with a property value that matches the value you specify. Specify the name of the property, the value to be matched, and the type of match (for example, equals, less than, or greater than). See Search Strings.
Searches for blocks of a specified block type. Select the target block type from the list of types contained in the currently selected model.
Searches for Stateflow objects of a specified type.
Searches for blocks that use variables defined in a workspace. Select the base workspace or a model workspace (model name) and, optionally, the name of a variable. See Search Strings.
Searches for variables that a model or block uses. Specify the name of the model or block in the by System field. The model or block must be in the Model Hierarchy pane.
Searches for variables that are defined in a workspace but not used by any model or block. Select the name of the workspace from the drop-down list for the in Workspace field.
Searches for library links in the current model.
Searches for Simulink objects of a specified class.
Searches a model for all blocks that support fixed-point computations.
Searches a model for references to other models.
Searches a model for all objects whose dialogs contain the prompt you specify. See Search Strings.
Searches a model for all objects in which the string you specify occurs. See Search Strings.
Use the Search Options control to specify the scope and how to apply search strings.
|Match Whole String|
Do not allow partial string matches (for example, do
Considers case when matching strings (for example,
Considers a string to be matched as a regular expression.
|Evaluate Property Values During Search|
Applies only for searches by property value. If enabled, Model Explorer evaluates the value of each property as a MATLAB expression and compares the result to the search value. If this option is disabled (the default), the Model Explorer compares the unevaluated property value to the search value.
Initiates a secondary search that provides additional search criteria to refine the initial search results. The second search operation searches for objects that meet both the original and the new search criteria.
For an example showing how to search for a parameter, see Search Using Model Explorer.
By default, search strings are case-insensitive and are treated as regular expressions.
By default, the search allows partial string matches. You cannot
use wildcard characters in search strings. For example, if you enter
a name search string, you get no search results unless there is an
item whose name starts with the two characters
If there is an
out1 item, the search results do
not include that item.
By default, the Model Explorer opens with three panes (Model Hierarchy, Contents, and Dialog), and a main toolbar. Open the search bar by selecting View > Toolbars > Search Bar.
|Main toolbar||Execute Model Explorer commands||
Most toolbar buttons perform actions that you can also perform using Model Explorer menu items, except to bring MATLAB to the front or open the Simulink Library Browser.
If you have Simulink Requirements™ installed, you can use additional toolbar buttons relating to requirements links.
|Search bar||Perform a search within the context of the selected node in Model Hierarchy pane.||Search Bar Controls|
|Model Hierarchy pane||Navigate and explore model, chart, and workspace nodes||Model Explorer: Model Hierarchy Pane|
|Contents pane||Display and modify model or chart objects||Model Explorer: Contents Pane|
|Dialog pane||View and change the details of object properties||Model Explorer: Property Dialog Pane|
You can use the Model Explorer to add many kinds of objects to a model, chart, or workspace. The types of objects that you can add depend on the node that you select in the Model Hierarchy pane. Use toolbar buttons or the Add menu to add objects. The Add menu lists the types of objects you can add.
As you explore a model or chart, you might want to narrow the contents that you see in the Model Explorer to particular elements of a model or chart. You can use several different techniques. The table summarizes techniques for controlling the content the Model Explorer displays and how the contents appear.
|Technique||When to Use||Documentation|
Show partial or whole model hierarchy contents
To control how much of a hierarchical model to display
Use the Row Filter option
To focus on, or hide, a specific kind of a model object, such as signals
To find objects that might not be currently displayed
To focus on specific objects in the Contents pane, based on a search string
Once you have the general set of data that you are interested in, you can use the following techniques to organize the display of contents.
|Technique||When to Use||Documentation|
To quickly organize data for a property in ascending or descending order
Group by property column
To logically group data based on values for a property
Use column views
To display a named subset of property columns to apply to different kinds of nodes in the Model Hierarchy pane
Add, delete, or rearrange property table columns
To customize property columns
The Model Hierarchy pane displays a tree-structured view of the Simulink model and Stateflow chart hierarchy. Use the Model Hierarchy pane to navigate to the part of the model and chart hierarchy that you want to explore.
Select the object in the Model Hierarchy pane whose contents you want to display in the Contents pane.
The first node in the hierarchy represents the Simulink root. Expand the root node to display nodes representing the MATLAB workspace, Simulink models, and Stateflow charts that are in the current session.
This node represents the MATLAB workspace. The MATLAB workspace is the base workspace for Simulink models and Stateflow charts. Variables defined in this workspace are visible to all open models and charts.
Expanding a model or chart node in the Model Hierarchy pane displays nodes representing the following elements, as applicable for the models and charts you have open.
For information about how to use the Model Explorer to work with model workspace variables, see the following sections:
Select the Configurations node to show the model's configuration sets and configuration references in the Contents pane. For information about adding, deleting, saving, and moving configuration sets, see Manage a Configuration Set.
Expand a node representing a subsystem to display underlying subsystems, if any.
Expand model blocks to show contents of referenced models (see Expand and Edit Model References).
By default, the Model Explorer displays objects for the system that you select in the Model Hierarchy pane. It does not display data for child systems. You can override that default, so that the Model Explorer displays objects for the whole hierarchy of the currently selected system. To toggle between displaying only the current system and displaying the whole system hierarchy of the current system, use one of these techniques:
Select View > Show Current System and Below.
Click the Show Current System and Below button at the top of the Contents pane.
When you select the Show Current System and Below option:
The Model Hierarchy pane highlights in pale blue the current system and its child systems.
After the path in the Contents of field, the text
(and below) appears.
The appearance of the Show Current System and Below button at the top of the Contents pane and in the View menu changes.
The status bar indicates the scope of the displayed objects when you hover over the Show Current System and Below button.
Loading very large models for the current system and below can be slow. To stop the loading process at any time, either click the Show Current System and Below button or click another node in the tree hierarchy.
If you show the current system and below, you might want to change the view to better reflect the displayed system contents. For details about views, see Customize Model Explorer Views.
The setting for the Show Current System and Below option is persistent across Simulink sessions.
By default, the Model Explorer does not display the contents of linked library subsystems or masked subsystems in the Model Hierarchy pane. To display the contents of linked library subsystems, use one of these approaches:
At the top of the Model Hierarchy pane, click the Show/Hide Library Links button or the Show/Hide Masked Subsystems button .
From the View menu, select Show Library Links or Show Masked Subsystems.
Library-linked subsystems and masked subsystems are visible in the Contents pane, regardless of how you configure the Model Hierarchy pane.
Search does not find elements in linked library or masked subsystems that are not displayed in the Model Hierarchy pane.
For subsystems that are both library-linked and masked, how you set the linked library subsystems and masked subsystems options affects which subsystems appear in the Model Hierarchy pane, as described in the following table.
|Settings||Subsystems Displayed in the Model Hierarchy Pane|
Show Library Links
Hide Masked Subsystems
Only library-linked, unmasked subsystems
Hide Library Links
Show Masked Subsystems
Only masked subsystems that are not library-linked subsystems
Show Library Links
Show Masked Subsystems
All library-linked or masked subsystems
To open a graphical object (for example, a model, subsystem, or chart) in an editor window, right-click the object in the Model Hierarchy pane, then select Open.
To browse a model that includes Model blocks, you can expand the
Model Hierarchy pane nodes of the Model blocks. For
sldemo_mdlref_depgraph model includes Model blocks
that reference other models. If you open the
sldemo_mdlref_depgraph model and expand that model node
in the Model Hierarchy pane, you see that the model
contains several Model blocks, including
To browse a model referenced by a Model block:
Right-click the referenced model node in the Model Hierarchy pane.
Select Open Model.
The referenced model opens.
The Model Hierarchy pane indicates that you can expand the Model block node (read-only).
The Contents pane displays objects corresponding to the Model block node (read-only).
The Model Hierarchy pane displays a separate expandable node for the referenced model.
For example, if you right-click the
heat2cost Model block
node and select Open Model, the
Contents pane displays the objects corresponding to the
heat2cost Model block. You can expand the
You can browse the contents of the referenced model, but you cannot edit the model objects that are inside the Model block.
To edit the referenced model, expand the referenced model node in the
Model Hierarchy pane, and then you access the
properties of objects in the referenced model. For example, expand the
For information about referenced models, see Model References.
To cut, copy, and paste workspace objects from one workspace into another workspace:
In the Contents pane, right-click on the workspace object you want to cut or copy.
Select Cut or Copy.
You can also cut a workspace object by selecting in the Contents pane Edit > Cut or by clicking the Cut button ().
You can also copy a workspace object by selecting Edit > Copy or by clicking the Copy button ().
If you want to paste the workspace object that you cut or copied, in the Model Hierarchy pane, right-click the workspace into which you want to paste the object, and select Paste.
You can also paste the object by selecting Edit > Paste or by clicking the Paste button ().
When you copy and paste (or drag and drop), you can manage the resolution of name conflicts. In the dialog box, choose an action for each item whose name conflicts with an existing item.
Skip — Default action when the
conflicting items have the same value.
Replace — Default action when
the conflicting items have different values.
Keep both — Preserve both
copies. The name given to the copied item follows
the naming rules that are used in the MATLAB workspace.
If the source and destination are the same, the software resolves the name conflict by following the naming rules that are used in the MATLAB workspace.
You can also cut, copy, and paste by selecting an object and performing drag and drop operations.
The Contents pane displays one of two tables containing information about models and charts, depending on the tab that you select:
The Contents tab displays an object property table for the node that you select in the Model Hierarchy pane.
The Search Results tab displays the search results table (see Search Using Model Explorer).
Optionally, you can also open a column view details section in the Contents pane. This graphic shows the Contents pane with the column view details section opened.
To open the column view details section, click Show Details, at the top of the Contents pane.
The Column view details section provides an interface for customizing the column view (hidden by default).
The Object property table section displays a table of model and chart object data (open by default).
In the object property table section of the Contents tab and in the Search Results tab:
Table columns correspond to object properties (for
The object property table displays the first two columns (the
object icon and the
Name property) persistently,
so that these columns remain visible regardless of how far you scroll
to the right.
Table rows correspond to objects (for example, blocks, and states).
The objects and properties displayed in the Contents pane depend on:
The column view that you select in the Contents pane
The node that you select in the Model Hierarchy pane
The kind of object (for example, subsystem or chart) that you select in the Model Hierarchy pane
The View > Row Filter options that you select
For more information about controlling which objects and properties to display in the Contents pane, see:
The Contents of link at the top left side of the
Contents pane links to the currently selected node in
the Model Hierarchy pane. The model data displayed in the
Contents pane reflects the setting of the Current System and
Below option. In this example, Contents
of links to the
vdp model, which is the
currently selected node.
The table summarizes the key tasks to control what is displayed in the Contents.
|Control which kinds of objects to display.||Use the Row Filter Option|
|Search within the selected set of objects.||Search Using Model Explorer|
|Specify a set of properties to display based on the kind of node.||Customize Model Explorer Views|
|Group data based on unique values in a property column.||Group by a Property|
|Manage views (for example, save and export a view).||Managing Views|
|Add, remove, or rearrange columns.||Organize Data Display in Model Explorer|
|Edit object property values.|
To open a properties dialog box for an object in the Model Hierarchy pane, right-click the object, and select Properties. Alternatively, click an object and from the Edit menu, select Properties.
You can change modifiable properties in the Contents pane (for example, a block name) by editing the displayed value. To edit a value, first select the row that contains the value, and then click the value. An edit control replaces the value (for example, an edit field for text values or a list for a range of values). For workspace variables that are arrays or structures, you can use the Variable Editor. Use the edit control to change the value of the selected property.
To assign the same property value to multiple objects in the Contents pane,
select the objects and then change one of the selected objects to
have the new property value. An edit control replaces the value with
indicating that you are doing batch editing. The Model Explorer assigns
the new property value to the other selected objects, as well.
You can also change property values using the Dialog pane. See Model Explorer: Property Dialog Pane.
You can control how the object property table and Search Results pane organize the layout of property information by:
Sorting column contents
Grouping by a property
Changing the order of property columns
Adding a property column
Hiding and removing property columns
To sort the column contents in ascending order, click the heading of the property column. A triangle pointing up appears in the column heading. To change the order from ascending to descending, or from descending to ascending, click the heading of the column again.
For example, if properties are in ascending order, based on
Name property (the default), click the heading
Name column to display objects by name,
in descending order.
By default, the Contents pane displays its contents in ascending order, based on the name of the object. Objects that have no values in any property columns appear at the end of the object property table.
When you group by property, the Model Explorer applies sorting of column contents within each group.
Organizing Contents by Property Values. When you explore a model, you might want to focus on all objects with the same property value. One approach is to group data by a property column.
For example, suppose that you want to see all of the blocks
f14 model. You could perform the following
The search results obscure the whole path name for lower-level nodes:
By grouping on the
Path property column,
you see the whole path for lower-level nodes.
You can also collapse groups to focus on specific parts of a model.
How to Group by a Property Column. To group by a property:
In the object property table, right-click the column heading of the property by which you want to group contents.
You can group by object icons, such as a block icon (), which represents a type of object. Right-click the empty column heading in the first column.
Select Group By This Column.
Sorting with Grouped Data. When you group by property, the Model Explorer applies sorting of column contents within each group.
Expanding and Collapsing Grouped Data. By default, Model Explorer displays groups in expanded form. That is, all the objects in each group are visible. You can collapse and expand groups.
To collapse the contents of a group, click the minus sign icon for that group.
To expand a group, click the plus sign.
To collapse or expand all the groups, right-click the column heading and select either Collapse All Groups (Shift+C) or Expand All Groups (Shift+E).
Hiding the Group Column. By default, the property column that you use for grouping appears in the property table. That property also appears in the top row for each group.
To hide the group column in the property table, use one of the following approaches:
From the View menu, clear the Show Group Column check box.
Right-click a column heading in the property table and clear the Show Group Column check box.
Persistence of Grouped Data Settings. If you group by a property, that grouping is saved as part of the view definition.
When you select a different node in the Model Hierarchy pane, the contents for the new node are grouped by that same property. However, all groups are expanded, even if you had collapsed all groups before switching nodes.
Group Search Results. You can use grouping to organize the Search Results pane. The grouping that you apply to the Search Results pane also applies to the object property table, if that property is in the table. If the search results include a property that is not in the object property table, and you group on that property, then the Model Explorer removes the grouping setting that was in effect in the object property table.
Object Icon and Name Columns Are Always First. The first two columns of every object property table are the
object icon column (the column with a blank column heading) and the
column. You cannot hide, remove, or change the location of the first
How to Change the Order of Property Columns. To change the order of property columns in the object property table, use one of these approaches:
In the object property table, select a column heading and drag it to a new location in the table.
This approach avoids opening the column view details section and makes it easier to move a column a short distance to the right or left.
In the column view details section, select one or more property columns and move them up or down in the list, using the arrow buttons to the right of the list.
This approach allows you to move several property columns in one step, but it moves the selected columns right or left by only one column at a time.
To move a property column by using the view details interface:
In the Display column names in this order list on the right side of the column view details section, select one or more property columns that you want to move.
Click the Move column left in view button or the Move column right in view button .
To add property columns to a view:
If you do not have the column view details section of the Contents pane already open, then at the top of the Contents pane, select Show Details.
In the list of properties on left side of the column view details section, select one or more properties that you want to add.
The list displays property names in alphabetical order. You can use the Find Properties search box in the column view details section to search for properties that contain the text string that you enter. You can specify the scope of the search with the From list to the right of the search box.
In the list of column names on the right side, select the property column that you want to be to the left of the property columns you insert.
Click the Display property as column in view button ()
Adding a Path Property Column. The Model Explorer provides a shortcut for adding a
column to a view. To add a
Path property column:
Right-click the column heading in the object property
table to the right of which you want to insert a
Select Insert Path.
You can choose between two approaches to hide (remove) a property column from the object property table. Hiding and removing a column both have the same result. You can:
Hide a column using the context menu for a column heading. This approach avoids needing to open the column view details section.
Remove a column using the column view details interface. This approach allows you to delete several properties in one step.
Hiding a Column Using the Column Heading Context Menu
Right-click the column heading of the column that you want to remove.
Removing a Column Using the Column View Details Interface
If you do not have the column view details section of the Contents pane already open, then at the top of the Contents pane, select Show Details.
In the column view details section of the Contents pane, in the Display column names in this order list, select one or more properties that you want to remove.
Click the Remove column from view button () or the Delete key.
Inserting Recently Hidden or Removed Columns. The Model Explorer maintains a list of columns you hide or remove for each view during a Simulink session.
To add a recently hidden or removed column back into a view:
Right-click the column heading of the column to the right of which you want to insert a recently hidden column.
Select Insert Recently Hidden Columns.
Select the column that you want to insert.
Usually, some of the properties that the Contents pane displays do not apply to all the displayed objects (in other words, some objects do not have values set). By default, the Model Explorer displays a dash (–) to mark properties that do not have a value.
If you want the Model Explorer to display a blank (instead of the default dash) in property cells that have no values, clear the View > Show Nonexistent Properties as “–” option. The Contents pane looks similar to the following graphic:
Two techniques that you can use to control the set of objects that the Contents pane displays are:
Using the Row Filter option
For a summary of other techniques, see Focus on Specific Elements of a Model or Chart.
You can filter the kinds of objects that the Contents pane displays:
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:
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 Events to prevent the display of Stateflow events 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).
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.
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.
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 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 the objects whose
property has a value that includes
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
fuel* in the Filter Contents text
box, you get no results, even if several objects contain the text
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 appears before you filter the contents, click 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.
Use the Dialog pane to view and change properties of objects that you select in the Model Hierarchy pane or in the Contents pane.
By default, the Dialog pane appears in the Model Explorer, to the right of the Contents pane. To show or hide the Dialog pane, use one of these approaches:
From the View menu, select Show Dialog Pane.
From the main toolbar, click the Dialog View button ().
To edit property values using the Dialog pane:
In the Contents pane, select an object (such as a block or signal). The Dialog pane displays the properties of the object you selected.
Change a property (for example, the port number of an Outport block) in the Dialog pane.
Click Apply to accept the change, or click Revert to return to the original value.
Click Apply to accept the changes or Ignore to revert to the original settings.
To prevent display of the Apply Changes dialog box:
In the dialog box, click the In the future Apply or Ignore (whichever I select) without asking check box.
If you want Simulink to apply changes without warning you, press Apply. If you want Simulink to ignore changes without warning you, press Ignore.
To restore display of the Apply Changes dialog box, from the Tools menu, select Prompt if dialog has unapplied changes.
When you select a numeric MATLAB variable or a
Simulink.Parameter object in a
model workspace, the Argument check box appears in the
Dialog pane. This check box configures the variable or object as a model
argument. See Parameterize Instances of a Reusable Referenced Model.