Main Content

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 behaviortoInlinedto 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 behaviortoTunableto 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 behaviortoInlinedor 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 toInlinedby 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 behaviortoInlinedif the top model hasDefault parameter behaviorset toInlined.

    • The top model can specifyDefault parameter behaviorasTunableorInlined.

  • If your model contains anEnvironment Controllerblock, you can suppress code generation for the branch connected to the Sim port if you setDefault parameter behaviortoInlinedand 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 Tunableduring development
Inlined佛r production code generation
Traceability Inlined
Efficiency Inlined
Safety precaution No impact

Related Topics