Explore Types of Subsystems
Subsystems can be virtual or nonvirtual.
Virtual subsystems help visually organize a block diagram. They play no active role in the simulation and do not affect simulation results.
Nonvirtual subsystems play an active role in the simulation of a system. If you add or remove a nonvirtual subsystem, you change the model behavior. Nonvirtual subsystems are atomic subsystems that execute as a single block, or atomic unit, when the parent model executes.
For controllers and other standalone components, define a hard boundary around the related blocks by using a nonvirtual subsystem or referenced model. Defining a hard boundary upfront avoids costly refactoring when you want to generate code for the component.
To determine whether a subsystem is virtual or nonvirtual, use either of these strategies:
This table classifies some of the types of nonvirtual subsystems.
|Basis of Subsystem Execution||Subsystem Description|
Subsystem Block Name
|Control signal value||Subsystem whose execution is enabled by external input.||Enabled Subsystem||Using Enabled Subsystems|
|Subsystem whose execution is triggered by external input.||Triggered Subsystem||Using Triggered Subsystems|
|Subsystem whose execution is enabled and triggered by external inputs.||Enabled and Triggered Subsystem||Using Enabled and Triggered Subsystems|
|Subsystem whose block states reset with an external trigger.||Resettable Subsystem||Using Resettable Subsystems|
|If-else logic||Subsystem whose execution is enabled by an If block.||If Action Subsystem||Select Subsystem Execution|
|Switch logic||Subsystem whose execution is controlled by a Switch Case block.||Switch Case Action Subsystem||Select Subsystem Execution|
|Function-call event||Subsystem whose execution is controlled by an external function-call input.||Function-Call Subsystem||Using Function-Call Subsystems|
|Number of iterations||Subsystem that repeats execution during a simulation time step for a specified number of iterations.||For Iterator Subsystem||Iterate Subsystem Execution with While Iterator and For Iterator Subsystems|
|Subsystem that repeats execution during a simulation time step while a logical condition is true.||While Iterator Subsystem||Iterate Subsystem Execution with While Iterator and For Iterator Subsystems|
|Number of elements||Subsystem that repeats execution on each element or subarray of input signal and concatenates results.||For Each Subsystem||Repeat an Algorithm Using a For-Each Subsystem|
|Message||Subsystem that executes conditionally at each time step based on whether a message is available at the control port.||Message Polling Subsystem||Using Message Polling and Message Triggered Subsystems|
|Subsystem that executes whenever a message is available at the control port, independent of sample time.||Message Triggered Subsystem||Using Message Polling and Message Triggered Subsystems|
|Execution order only||Subsystem that executes as a single block, or atomic unit, when the parent model executes.||Atomic Subsystem||Specify Whether Subsystem Is Atomic|