Main Content

Conditional input branch execution

Option to optimize input paths for Switch and Multiport Switch blocks

Model Configuration Pane: Simulation Target

Description

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.

Settings

on (default) | off
on

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

off

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

Recommended Settings

ApplicationSetting
DebuggingNo impact
Traceabilityon
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