Default parameter behavior
Represent numeric block parameters in generated code
Model Configuration Pane: Code Generation / Optimization
Description
The Default parameter behavior parameter specifies how to represent numeric block parameters in the generated code.
Dependencies
When you set Default parameter behavior to Inlined, you enable Inline invariant signals configuration parameter.
Settings
Tunable for GRT targets,
Inlined for ERT targets (default)InlinedSet Default parameter behavior to
Inlinedto 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.TunableSet Default parameter behavior to
Tunableto 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
Inlinedor toTunable, create parameter data objects to preserve tunability for block parameters. For more information, see Create Tunable Calibration Parameter in the Generated Code.If you configure a block parameter to use the storage class
Define, the generated code uses variables with#definemacros to represent the parameter, and the storage class setting overrides Default parameter behavior.When you switch from a system target file that is not ERT-based to one that is ERT-based, Default parameter behavior sets to
Inlinedby 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
Inlinedif the top model has Default parameter behavior set toInlined.The top model can specify Default parameter behavior as
TunableorInlined.
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
Inlinedand the branch does not contain external signals.
Recommended Settings
| Application | Setting |
|---|---|
| Debugging | Tunable during developmentInlined for production code generation |
| Traceability | Tunable |
| Efficiency | Inlined |
| Safety precaution | No impact |
Programmatic Use
Parameter: DefaultParameterBehavior |
| Type: character vector |
Value: 'Inlined' | 'Tunable' |
Default: 'Tunable' for GRT targets | 'Inlined' for ERT targets |
Version History
Introduced in R2015b