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.
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.
To display a Configuration Preferences node in the expanded Simulink Root node, enable the View > Show Configuration Preferences option. Selecting this node displays the preferred configuration for new models (see Manage a Configuration Set). You can change the preferred configuration by editing the displayed settings and using the Model Configuration Preferences dialog box to save the settings (see Model Configuration Preferences).
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:
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 Expanding 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,
(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 Control Model Explorer Contents Using 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 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 ( ).
From the View menu, select Show Library Links.
Library-linked subsystems are visible in the Contents pane, regardless of how you configure the Model Hierarchy pane.
Note: Search does not find elements in linked library or masked subsystems that are not displayed in the Model Hierarchy pane.
By default, the Model Explorer does not display the contents of masked subsystems in the Model Hierarchy pane. To display the contents of masked subsystems, use one of these approaches:
At the top of the Model Hierarchy pane, click the Show/Hide Masked Subsystems button ( ) .
From the View menu, select Show Masked Subsystems.
Masked subsystems are visible in the Contents pane, regardless of how you configure 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
Select the object in the Model Hierarchy pane whose contents you want to display in the Contents pane.
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. From the context menu, select Open.
See Manage a Configuration Set for information about using the Model Hierarchy pane to perform tasks such as adding, deleting, saving, and moving configuration sets.
To browse a model that includes Model blocks, you can expand
the Model Hierarchy pane nodes of the Model blocks.
For example, the
includes Model blocks that reference other models. If you open the
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.
From the context menu, choose Open Model.
The referenced model opens.
The Model Hierarchy pane indicates that you can expand the Model block node.
The Model Hierarchy pane displays a separate expandable node for the referenced model (read-only).
The Contents pane displays objects corresponding to the Model block node (read-only).
For example, if you right-click the
block node and select the Open Model option,
the Contents pane displays the objects corresponding
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 underneath the Model block.
To edit the referenced model, expand the referenced model node
in the Model Hierarchy pane. For example, expand
You can now edit the properties of object in the referenced model.
For information about referenced models, see Model Reference.
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.
From the context menu, 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 ( ).
You can also perform cut, copy, and paste operations by selecting an object and performing drag and drop operations.