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

Using subsystems:

  • Establishes a hierarchical block diagram, where aSubsystemblock 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, seeChoose Among Types of Model Components.

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.

Blocks

Subsystem Group blocks to create model hierarchy

Functions

expand all

Simulink.BlockDiagram.createSubsystem Create subsystem containing specified set of blocks
Simulink.BlockDiagram.copyContentsToSubsystem Copy graphical contents from system to empty subsystem
Simulink.BlockDiagram.expandSubsystem Replace subsystem with subsystem contents
Simulink.SubSystem.convertToModelReference Convert subsystem to model reference
Simulink.SubSystem.copyContentsToBlockDiagram Copy graphical contents from subsystem to empty system
Simulink.SubSystem.deleteContents Delete contents of subsystem
convertAllSubsystemReferenceBlockToSubsystem Converts all subsystem reference blocks to regular Subsystem blocks
convertSubsystemReferenceBlockToSubsystem Converts a subsystem reference block to a regular Subsystem block
convertSubsystemToSubsystemReference Converts a Subsystem block to subsystem reference
getActiveInstances Returns all the active instances of subsystem references
getAllDirtyInstances Returns child Subsystem block diagrams that are referred in the given block diagram and are also being edited
getAllInstances Returns all subsystem reference blocks inside a block diagram
getAllReferencedSubsystemBlockDiagrams Returns all the child Subsystem block diagrams for a given block diagram
getNearestParentSubsystemReferenceBlock Returns the nearest parent subsystem reference for a block
getSystemOwningTheLock Returns the system that has acquired the lock for editing
isSystemLocked Checks if the system is locked due to an edit or update to the subsystem reference

Tools

模型参考转换顾问 Convert subsystems to referenced models
Referenced Files Pane View, save, and close referenced subsystems and models

Topics

Subsystems

Subsystem References