This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Conditional input branch execution


Improve model execution when the model contains Switch and Multiport Switch blocks.

Category: Simulation Target


Default: On


Executes only the blocks required to compute the control input and the data input selected by the control input. This optimization speeds execution of code generated from the model. Limits to Switch block optimization:

  • Only blocks with -1 (inherited) or inf (Constant) sample time can participate.

  • Blocks with outputs flagged as test points cannot participate.

  • No multirate block can participate.

  • Blocks with states cannot participate.

  • Only S-functions with option SS_OPTION_CAN_BE_CALLED_CONDITIONALLY set can participate.


Executes all blocks driving the Switch block input ports at each time step.

Command-Line Information

Parameter: ConditionallyExecuteInputs
Value: 'on' | 'off'
Default: 'on'

Recommended Settings

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

Related Topics