Skip to Main Content Skip to Search
Product Documentation

The Model Explorer: Model Hierarchy Pane

What You Can Do with the Model Hierarchy Pane

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.

Simulink Root

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.

Base Workspace

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.

For information about exporting and importing workspace variables, see Exporting Workspace Variables and Importing Workspace Variables.

Configuration Preferences

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).

Model Nodes

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.

NodeDescription

Model workspace

For information about how to use the Model Explorer to work with model workspace variables, see the following sections:

Configuration sets

For information about adding, deleting, saving, and moving configuration sets, see Manage a Configuration Set.

Top-level subsystems

Expand a node representing a subsystem to display underlying subsystems, if any.

Model blocks

Expand to model blocks to show contents of referenced models (see Expanding Model References).

Stateflow charts

  • Expand a node representing a Stateflow chart to display the top-level states of the chart.

  • Expand a node representing a state to display its substates.

Displaying Linked Library Subsystems

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:

Library-linked subsystems are visible in the Contents pane, regardless of how you configure the Model Hierarchy pane.

Displaying Masked Subsystems

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:

Masked subsystems are visible in the Contents pane, regardless of how you configure the Model Hierarchy pane.

Linked Library and Masked Subsystems

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.

SettingsSubsystems 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

Displaying Node Contents

Select the object in the Model Hierarchy pane whose contents you want to display in the Contents pane.

Navigating to the Block Diagram

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.

Working with Configuration Sets

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.

Expanding Model References

To browse a model that includes Model blocks, you can expand the Model Hierarchy pane nodes of the Model blocks. For example, the sldemo_mdlref_depgraph demo 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 heat2cost.

To browse a model referenced by a Model block:

  1. Right-click the referenced model node in the Model Hierarchy pane.

  2. 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 heat2cost Model block node and select the Open Model option, the Contents pane displays the objects corresponding to the heat2cost Model block. You can expand the heat2cost node.

You can browse the contents of the referenced model, but you cannot edit the model objects that are underneath the Model block.

Editing the Referenced Model

To edit the referenced model, expand the referenced model node in the Model Hierarchy pane. For example, expand the sldemo_mdlref_heat2cost node:

You can now edit the properties of object in the referenced model.

For information about referenced models, see Referencing a Model.

Cutting, Copying, and Pasting Objects

To cut, copy, and paste workspace objects from one workspace into another workspace:

  1. In the Contents pane, right-click on the workspace object you want to cut or copy.

  2. 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 ( ).

  3. 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.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS