Main Content

Conditional input branch execution

Option to optimize input paths for Switch and Multiport Switch blocks

Model Configuration Pane: Simulation Target


This parameter specifies whether the software optimizes input paths for Switch and Multiport Switch blocks. The software optimizes by executing only the blocks required to compute the control input and the data input selected by the control input. This optimization improves execution speed of simulation and generated code. It has these limitations:

  • Blocks that determine the input values must:

    • Have inherited (-1) or constant (inf) sample time

    • Not have output signals designated as test points

    • Not be multirate

    • Not have states

  • Model blocks are not supported.

  • S-Function blocks are supported only when you enable the SS_OPTION_CAN_BE_CALLED_CONDITIONALLY option.


on (default) | off

The software optimizes the execution of blocks that determine the control and data inputs for Switch and Multiport Switch blocks.


The software executes blocks driving the Switch and Multiport Switch block input ports at each time step.

Recommended Settings

DebuggingNo impact
Efficiencyon (execution), No impact (ROM, RAM)
Safety precautionNo impact

Programmatic Use

Parameter: ConditionallyExecuteInputs
Type: string | character vector
Values: 'on' | 'off'
Default: 'on'

Version History

Introduced in R2008a