Default parameter behavior
Description
Transform numeric block parameters into constant inlined values in the generated code.
Category: Optimization
Settings
Default:Tunable
佛r GRT targets |Inlined
佛r ERT targets
-
Inlined
-
SetDefault parameter behaviorto
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 theGainparameter of aGainblock. Instead, the code inlines the literal numeric values of these block parameters. -
Tunable
-
SetDefault parameter behaviorto
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 setDefault parameter behaviorto
Inlined
or toTunable
, create parameter data objects to preserve tunability for block parameters. For more information, seeCreate 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 behaviorsets to
Inlined
by default. However, you can change the setting ofDefault parameter behaviorlater.When a top model uses referenced models or if a model is referenced by another model:
Referenced models must setDefault parameter behaviorto
Inlined
if the top model hasDefault parameter behaviorset toInlined
.The top model can specifyDefault parameter behavioras
Tunable
orInlined
.
If your model contains anEnvironment Controllerblock, you can suppress code generation for the branch connected to the Sim port if you setDefault parameter behaviorto
Inlined
and the branch does not contain external signals.
Dependencies
When you setDefault parameter behaviortoInlined
, you enableInline invariant signalsconfiguration parameter.
Command-Line Information
Parameter:DefaultParameterBehavior |
Type:character vector |
Value:'Inlined' |'Tunable' |
Default:'Tunable' 佛r GRT targets |'Inlined' 佛r ERT targets |
Recommended Settings
Application | Setting |
---|---|
Debugging | Tunable during developmentInlined 佛r production code generation |
Traceability | Inlined |
Efficiency | Inlined |
Safety precaution | No impact |