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.
Subsystem | Group blocks to create model hierarchy |
Simulink.BlockDiagram.createSubsystem | Create subsystem containing specified set of blocks |
Simulink.BlockDiagram.copyContentsToSubsystem | Copy contents of block diagram to empty subsystem |
Simulink.BlockDiagram.expandSubsystem | Replace subsystem with subsystem contents |
Simulink.SubSystem.convertToModelReference | Convert subsystem to model reference |
Simulink.SubSystem.copyContentsToBlockDiagram | Copy contents of subsystem to empty block diagram |
Simulink.SubSystem.deleteContents | Delete contents of subsystem |
Fundamentals of subsystems.
How to create subsystems.
Set subsystem execution, behavior, and access.
Navigate model hierarchy of subsystems and referenced models.
Preview Content of Model Components
Display representation of block contents on the face of a block.
Flatten a model hierarchy by bringing the contents of a subsystem up one level.
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.
Component-Based Modeling Guidelines
Consider componentization for large models and multiuser development teams.
Flatten a model hierarchy by bringing the contents of a subsystem up one level.