Main Content

Subsystems

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 on one layer and the blocks that make up the subsystem are on another.

  • Keeps functionally related blocks together.

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

  • Establishes an interface with inputs and outputs.

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, consider referenced subsystems, referenced models, or subsystems linked to a block in a custom library. For more information, see Explore Types of Model Components.

A subsystem can be virtual or nonvirtual. A virtual subsystem provides graphical hierarchy in a model. A nonvirtual subsystem provides graphical hierarchy and executes as a unit within a model.

Blocks

SubsystemGroup blocks to create model hierarchy

Functions

expand all

Simulink.BlockDiagram.createSubsystemCreate subsystem containing specified set of blocks
Simulink.BlockDiagram.copyContentsToSubsystemCopy graphical contents from system to empty subsystem
Simulink.BlockDiagram.expandSubsystemReplace subsystem with subsystem contents
Simulink.SubSystem.convertToModelReferenceConvert subsystems to models
Simulink.SubSystem.copyContentsToBlockDiagramCopy graphical contents from subsystem to another model
Simulink.SubSystem.deleteContentsDelete contents of subsystem
Simulink.SubsystemReference.convertSubsystemToSubsystemReferenceConvert Subsystem block to Subsystem Reference block (Since R2022a)
Simulink.SubsystemReference.convertSubsystemReferenceBlockToSubsystemConvert Subsystem Reference block to Subsystem block (Since R2022a)
Simulink.SubsystemReference.convertAllSubsystemReferenceBlocksToSubsystemConvert all Subsystem Reference blocks to Subsystem blocks (Since R2022a)
Simulink.SubsystemReference.getAllInstancesReturn all Subsystem Reference blocks in model (Since R2022a)
Simulink.SubsystemReference.getActiveInstancesReturn active instances of subsystem reference (Since R2022a)
Simulink.SubsystemReference.getAllDirtyInstancesReturn subsystem files referenced in model that are currently being edited (Since R2022a)
Simulink.SubsystemReference.getNearestParentSubsystemReferenceBlockReturn nearest parent Subsystem Reference block for specified block (Since R2022a)
Simulink.SubsystemReference.getAllReferencedSubsystemBlockDiagramsReturn all subsystem files referenced in model (Since R2022a)
Simulink.SubsystemReference.getSystemOwningTheLockReturn subsystem reference instance that has acquired lock for editing (Since R2022a)
Simulink.SubsystemReference.isSystemLocked Check if subsystem file is locked due to edit or update (Since R2022a)
Simulink.SubsystemReference.generateSignaturesGenerate unit test signatures of subsystem file (Since R2023a)
Simulink.SubsystemReference.getUnitTestNamesReturn names of unit tests of subsystem file (Since R2023a)
Simulink.SubsystemReference.removeSignaturesRemove previously generated unit test signatures of subsystem file (Since R2023a)
Simulink.SubsystemReference.showSignatureDiffDialogForSSDisplay differences in signatures of two Subsystem blocks (Since R2023a)
Simulink.SubsystemReference.showSignatureDiffDialogForUnitTestsDisplay differences in signatures of Subsystem Reference block in model with unit test signatures of subsystem file (Since R2023a)

Tools

Model Reference Conversion AdvisorConvert subsystems to referenced models
Referenced Files PaneView, save, and close referenced subsystems and models (Since R2020b)
Component Interface ViewDisplay component interfaces to trace port connections and author ports

Topics

Subsystems

Subsystem References