Using Simulink | ![]() ![]() |
Creating Conditionally Executed Subsystems
A conditionally executed subsystem is a subsystem whose execution depends on the value of an input signal. The signal that controls whether a subsystem executes is called the control signal. The signal enters the Subsystem block at the control input.
Conditionally executed subsystems can be very useful when you are building complex models that contain components whose execution depends on other components.
Simulink supports three types of conditionally executed subsystems:
if-else
and switch
control flow, the control block resides outside the controlled subsystem and issues a control signal to an Action Port block residing inside the controlled subsystem. In the case of while
, do-while
, and for
control flow, a block with iterative control resides inside the subsystem, which it controls without an apparent control signal. See Control Flow Blocks for more information.
![]() | Controlling Access to Subsystems | Enabled Subsystems | ![]() |