Group blocks into functional subsystems, create model hierarchy

As a model increases in size and complexity, you can simplify it by grouping blocks into subsystems. A subsystem is a set of blocks that you group into a single Subsystem block.

Using subsystems:

  • Establishes a hierarchical block diagram, where a Subsystem block is in one layer and the blocks that make up the subsystem are in another

  • Keeps functionally related blocks together

  • Helps reduce the number of blocks displayed in your model window

When you make a copy of a subsystem, that copy is independent of the source subsystem. To reuse the contents of a subsystem across a model or across models, use a library or convert the subsystem to a referenced model. To identify the most suitable model component for your application, see Component-Based Modeling Guidelines.

A subsystem can be virtual or nonvirtual. A virtual subsystem provides graphical hierarchy in a model and does not impact the execution of a model. A nonvirtual subsystem executes as a single unit within a model. For information on conditionally executed subsystems, see Conditionally Executed Subsystems and Models.


SubsystemGroup blocks to create model hierarchy


expand all

Simulink.BlockDiagram.createSubsystemCreate subsystem containing specified set of blocks
Simulink.BlockDiagram.copyContentsToSubsystemCopy contents of block diagram to empty subsystem
Simulink.BlockDiagram.expandSubsystemReplace subsystem with subsystem contents
Simulink.SubSystem.convertToModelReferenceConvert subsystem to model reference
Simulink.SubSystem.copyContentsToBlockDiagramCopy contents of subsystem to empty block diagram
Simulink.SubSystem.deleteContentsDelete contents of subsystem



Subsystem Basics

Fundamentals of subsystems.

Create a Subsystem

How to create subsystems.

Expand Subsystem Contents

Flatten a model hierarchy by bringing the contents of a subsystem up one level.

Configure a Subsystem

Set subsystem execution, behavior, and access.

Navigate Model Hierarchies

Navigate model hierarchy of subsystems and referenced models.

Preview Content of Model Components

Display representation of block contents on the face of a block.

Subsystem References

Subsystem Reference

Save a subsystem in a separate file and reference it in a model.

Reference a Subsystem Component in a Model

Use subsystem reference in a model.