Default parameter behavior
Description
Transform numeric block parameters into constant inlined values in the generated code.
Category: Optimization
Settings
Default:
Tunable
for GRT targets |
Inlined
for ERT targets
Inlined
Set Default parameter behavior to
Inlined
to reduce global RAM usage and increase efficiency of the generated code. The code does not allocate memory to represent numeric block parameters such as the Gain parameter of a Gain block. Instead, the code inlines the literal numeric values of these block parameters.Tunable
Set Default parameter behavior to
Tunable
to enable tunability of numeric block parameters in the generated code. The code represents numeric block parameters and variables that use the storage classAuto
, including numeric MATLAB® variables, as tunable fields of a global parameters structure.
Tips
Whether you set Default parameter behavior to
Inlined
or toTunable
, create parameter data objects to preserve tunability for block parameters. For more information, see Create Tunable Calibration Parameter in the Generated Code.When you switch from a system target file that is not ERT-based to one that is ERT-based, Default parameter behavior sets to
Inlined
by default. However, you can change the setting of Default parameter behavior later.When a top model uses referenced models or if a model is referenced by another model:
Referenced models must set Default parameter behavior to
Inlined
if the top model has Default parameter behavior set toInlined
.The top model can specify Default parameter behavior as
Tunable
orInlined
.
If your model contains an Environment Controller block, you can suppress code generation for the branch connected to the Sim port if you set Default parameter behavior to
Inlined
and the branch does not contain external signals.
Dependencies
When you set Default parameter behavior to
Inlined
, you enable Inline invariant signals configuration parameter.
Command-Line Information
Parameter:
DefaultParameterBehavior |
Type: character vector |
Value:
'Inlined' | 'Tunable' |
Default:
'Tunable' for GRT targets | 'Inlined'
for ERT targets |
Recommended Settings
Application | Setting |
---|---|
Debugging | Tunable during
developmentInlined
for production code generation |
Traceability | Inlined |
Efficiency | Inlined |
Safety precaution | No impact |