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.
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.
|Subsystem||Group blocks to create model hierarchy|
|Create subsystem containing specified set of blocks|
|Copy graphical contents from system to empty subsystem|
|Replace subsystem with subsystem contents|
|Convert subsystem to model reference|
|Copy graphical contents from subsystem to another model|
|Delete contents of subsystem|
Subsystem Reference Functions
|Converts all subsystem reference blocks to regular Subsystem blocks (Since R2022a)|
|Converts a subsystem reference block to a regular Subsystem block (Since R2022a)|
|Converts a Subsystem block to subsystem reference (Since R2022a)|
|Returns all the active instances of subsystem references (Since R2022a)|
|Returns child Subsystem block diagrams that are referred in the given block diagram and are also being edited (Since R2022a)|
|Returns all subsystem reference blocks inside a block diagram (Since R2022a)|
|Returns all the child Subsystem block diagrams for a given block diagram (Since R2022a)|
|Returns the nearest parent subsystem reference for a block (Since R2022a)|
|Returns the system that has acquired the lock for editing (Since R2022a)|
|Checks if the system is locked due to an edit or update to the subsystem reference (Since R2022a)|
|Generate unit test signatures of subsystem file (Since R2023a)|
|Return names of unit tests of subsystem file (Since R2023a)|
|Remove previously generated unit test signatures of subsystem file (Since R2023a)|
|Open dialog to show difference in signatures of two subsystem blocks (Since R2023a)|
|Open dialog to show difference in signatures of subsystem reference instance with unit test signatures (Since R2023a)|
- Explore Types of Subsystems
Decide among virtual and nonvirtual subsystems, including conditionally executed subsystems.
- Group Blocks into Subsystems
Use subsystems to organize large models.
- Expand Subsystem Contents
Flatten a model hierarchy by bringing the contents of a subsystem up one level.
- Connect Subsystems
Add ports to subsystems and configure port labels.
- Navigate Model Hierarchy
Navigate model hierarchy using the Explorer Bar and Model Browser.
- Preview Content of Model Components
Display representation of block contents on the face of a block.
- Subsystem Reference
Save a subsystem in a separate file and reference it in a model.
- Reference a Subsystem File in a Model
Use subsystem reference in a model.
- Change Subsystem Reference Component Dynamically Using InitFcn
This example shows how to dynamically change the subsystem reference component using the Initialization Function.
- Validate Subsystem Reference Use and Build Model Using Component Codes
This example shows how to check the valid use of subsystem reference instances in a model and reuse generated subsystem component codes to build the model using unit testing.