Main Content

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. When using Embedded Coder® for a component model that is configured with a service interface, this parameter must be set to Inlined.

Dependencies

When you set Default parameter behavior to Inlined, you enable Inline invariant signals configuration parameter.

Settings

Tunable for GRT targets (default)Inlined for ERT targets (default)
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 class Auto, including numeric MATLAB® variables, as tunable fields of a global parameters structure.

Tips

  • Whether you set Default parameter behavior to Inlined or to Tunable, 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 to Inlined.

    • The top model can specify Default parameter behavior as Tunable or Inlined.

  • 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.

Recommended Settings

ApplicationSetting
DebuggingTunable during development
Inlined for production code generation
TraceabilityTunable
EfficiencyInlined
Safety precautionNo 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