Preserve operand order in expression
Preserve order of operands in expressions
Model Configuration Pane: Code Generation / Code Style
Description
Specify whether to preserve order of operands in expressions.
Settings
off (default) | onDefault: off
- On
Preserves the expression order specified in the model. Select this option to increase readability of the code or for code traceability purposes.
Note
This setting applies to Embedded Coder® only and might not affect order of operands inside Stateflow® charts.
- Off
Optimizes efficiency of code for nonoptimized compilers by reordering commutable operands to make expressions left-recursive.
Examples
Recommended Settings
| Application | Setting |
|---|---|
| Debugging | On |
| Traceability | On |
| Efficiency | Off |
| Safety precaution | No recommendation |
Programmatic Use
Parameter: PreserveExpressionOrder |
| Type: character vector |
Value: 'on' | 'off' |
Default: 'off' |
Version History
Introduced in R2007a