Main Content

Eliminate superfluous local variables (Expression folding)

Specify to fold expressions into single expression

Model Configuration Pane: Code Generation / Optimization

Description

The Eliminate superfluous local variables (Expression folding) parameter specifies whether to collapse block computations into single expressions.

Category: Optimization

Dependencies

This parameter is enabled by Signal storage reuse.

Settings

on (default) | off
On
  • Enables expression folding.

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

  • Improves code readability and efficiency.

Off

Disables expression folding.

Recommended Settings

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

Programmatic Use

Parameter: ExpressionFolding
Type: character vector
Value: 'on' | 'off'
Default: 'on'

Version History

Introduced before R2006a