Main Content

Rate Transition block code

Format for rate transition block code and data

Model Configuration Pane: Code Generation / Code Placement


Specify the format for Rate Transition block code and data. Inline the code with the model code or create separate functions that the model code calls with state data in a dedicated structure.


  • This parameter requires an Embedded Coder® license.

  • Appears only for ERT-based targets.


Inline (default) | Function

Default: Inline


Inline Rate Transition block code with model code. Declare Rate Transition block state data in global block state structure.


Separate Rate Transition block code and data from the model code and data. The generated code contains separate get and set functions that the model_step functions call and a dedicated structure for state data. The generated code also contains separate start and initialize functions that the model_initialize function calls.

Recommended Settings

Safety precautionNo impact


  • The code generator does not separate code and data for Rate Transition blocks that have variable-size signals or are inside a For Each Subsystem block.

  • In the Rate Transition block parameters dialog box,​ you must select the Ensure data integrity during data transfer parameter. If you do not select this parameter,​ the model produces an error during code generation.

  • In Configuration Parameters dialog box,​ the Multitask data transfer parameter must be set to error. If this parameter is not set to error,​ Embedded Coder disables the Rate Transition block code parameter and the code generator inlines Rate Transition block code.

Programmatic Use

Parameter: RateTransitionBlockCode
Value: 'Inline' | 'Function' |
Default: 'Inline'

Version History

Introduced in R2018a

See Also