Select subsystem execution using logic similar to if-else statement
Simulink / Ports & Subsystems
The If block, along with If Action Subsystem blocks containing an Action Port block, implements if-else logic to control subsystem execution. For an example using the If block, see If Action Subsystems.
The If block has the following limitations:
It does not support tunable parameters. Values for an if
or
elseif
expression cannot be tuned during a simulation in
normal or accelerator mode, or when running generated code.
To implement tunable if-else expressions, tune the expression outside the If block. For example, use the Relational Operator block to evaluate the expression outside of the If block or add the tunable parameter as an input to the If block.
It does not support custom storage classes. See Organize Parameter Data into a Structure by Using Struct Storage Class (Embedded Coder).
The If expression and Elseif
expressions cannot accept certain operators, such as +,
-, *
, and /
.
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|