Action Port

Implement Action subsystems used in if and switch control flow statements


Ports & Subsystems


Action Port blocks implement action subsystems used in if and switch control flow statements. The If Action Subsystem and the Switch Case Action Subsystem blocks each contain an Action Port block.

Data Type Support

Action Port blocks do not have data inputs or outputs.


States when execution is resumed

Specify how to handle internal states when a subsystem with an Action Port block reenables.


Default: held


When the subsystem reenables, retains the states of the Action subsystem with their previous values. Retains the previous values of states between calls even if calling other member Action subsystems of an if-else or switch control flow statement.


Reinitializes the states of the Action subsystem to initial values when the subsystem reenables.

Reenablement of a subsystem occurs when called and the condition of the call is true after having been previously false. In the following example, the Action Port blocks for both Action subsystems A and B have the States when execution is resumed parameter set to reset.

If case[1] is true, call Action subsystem A. This result implies that the default condition is false. When later calling B for the default condition, its states are reset. In the same way, Action subsystem A states are reset when calling A right after calling Action subsystem B.

Repeated calls to the Action subsystem of a case does not reset its states. If calling A again right after a previous call to A, this action does not reset the states of A. This behavior is because the condition of case[1] was not previously false. The same applies to B.

Command-Line Information

Parameter: InitializeStates
Type: character vector
Value: 'held' | 'reset' |
Default: 'held'

Propagate sizes of variable-size signals

Specify when to propagate a variable-size signal.


Default: Only when execution is resumed

Only when execution is resumed

Propagates variable-size signals only when reenabling the subsystem containing the Action Port block.

During execution

Propagates variable-size signals at each time step.

Command-Line Information

Parameter: PropagateVarSize
Type: character vector
Value: 'Only when execution is resumed' | 'During execution'
Default: 'Only when execution is resumed'


Sample Time

Inherited from driving If or Switch Case block

Introduced before R2006a

Was this topic helpful?