Main Content

Eliminate superfluous local variables (Expression folding)

Description

Collapse block computations into single expressions.

Category: Optimization

Settings

Default: On

On
  • Enables expression folding.

  • Eliminates local variables, incorporating the information into the main code statement.

  • Improves code readability and efficiency.

Off

Disables expression folding.

Dependencies

  • This parameter requires a Simulink® Coder™ license.

  • This parameter is enabled by Signal storage reuse.

Command-Line Information

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

Recommended Settings

ApplicationSetting
DebuggingOff
TraceabilityNo impact for simulation or during development
Off for production code generation
EfficiencyOn
Safety precautionNo impact

Related Topics