Main Content

Navigate Model Hierarchy

You can use Simulink® Subsystem and Model blocks and Stateflow® charts to create a model hierarchy.

  • Subsystem blocks are blocks that contain model elements, such as blocks, signal lines, or annotations. For more information, see Create Subsystems.

  • Subsystem Reference blocks are blocks that store the contents of a subsystem as a separate file.

  • Model blocks are blocks that reference one model inside another model. For more information, see Model Reference Basics.

  • Chart (Stateflow) blocks are flow charts that contain Stateflow model elements, such as states and transitions.

The hierarchy can have multiple levels.

  • A Subsystem block can contain Subsystem blocks, Subsystem Reference blocks, Model blocks, and charts.

  • A Subsystem Reference block can contain Subsystem blocks, Subsystem Reference blocks, Model blocks, and charts.

  • A model referenced by a Model block can contain Subsystem blocks, Model blocks, and charts.

  • A Chart block can contain subcharts.

Each Subsystem block, Subsystem Reference block, Model block, or chart you enter takes you one level deeper in the model hierarchy.

You can navigate down the model hierarchy by double-clicking Subsystem, Subsystem Reference, Model, or Chart blocks in the canvas.

You can navigate up the model hierarchy by clicking higher levels in the Explorer Bar.

Inside a Model block, the Explorer Bar is highlighted on the Simulink Editor

To navigate down or up the model hierarchy of complex models, use the Model Browser instead.

To navigate to a specific item in the model, use the Finder or Model Data Editor. For more information, see Search Model Contents.

Enter and Exit Subsystems

To enter a subsystem, double-click the Subsystem or Subsystem Reference block.

To return to the level of the model hierarchy from which you entered the subsystem, complete one of these actions.

  • In the Explorer Bar, click the level from which you entered the subsystem.

  • Click the Back button .

  • Click the Up to Parent button .

The video shows the Van der Pol Equation model. Part of the model is converted into a subsystem. To enter the subsystem, the pointer double-clicks the Subsystem block. To return to the previous level of the model hierarchy, the pointer clicks the Back button. To enter the subsystem again, the pointer double-clicks the Subsystem block. The explorer bar shows the names of the two levels of model hierarchy, vdp and Subsystem. To return to the top level of the model hierarchy, in the Explorer Bar, the pointer clicks vdp.

Enter and Exit Model References

You can open the model referenced by a Model block in the Simulink window that contains the Model block or in a separate window.

To open the model in the window that contains the Model block, double-click the Model block. To return to the level of the model hierarchy from which you entered the model, complete one of these actions.

  • In the Explorer Bar, click the level from which you entered the referenced model.

  • Click the Back button .

  • Click the Up to Parent button .

To open the model in a separate window, on the Model block icon, click Button for opening model reference. To exit the referenced model, close the window.

Navigate Model Hierarchy Tree Using Model Browser

To open the Model Browser, in the Simulink Editor, on the Modeling tab, select Environment > Model Browser.

To view the model hierarchy, expand the Model Browser tree.

To navigate to a level of the hierarchy, click the level in the tree.

To hide or restore the Model Browser, click the Hide/Show Model Browser button .

To specify whether to display referenced models, library links, or systems with mask parameters in the tree, click Icon of Model Browser list for specifying which items to display.

In the Model Browser tree for the sldemo_fuelsys model, part of the tree is expanded. The Hide/Show Model Browser button is highlighted. The menu for selecting whether to display referenced models, library links or systems with mask parameters is expanded.

Related Topics