Main Content

Include model types in model class

Whether code generator places model type definitions in model class

Since R2020a

Model Configuration Pane: Code Generation / Interface

Description

The Include model types in model class parameter specifies whether the code generator places model type definitions in a model class.

Settings

On (default) | Off
On

Enables generation of model type definitions within the model class namespace. Model type definitions include:

  • Root-level inports and outports

  • Block inputs and outputs

  • DWork vectors

  • Block and constant parameters

  • Continuous states

  • Real-time model data structure (rtModel)

The generated code reduces the MISRA 7-3-1 violations.

A user-defined type, such as a Simulink.Bus object or a type defined in a MATLAB Function block or Stateflow® chart is still generated in the global namespace.

Off

Disables generation of model type definitions within the global namespace.

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyOn
Safety precaution

No recommendation

Programmatic Use

Parameter: IncludeModelTypesInModelClass
Type: character vector
Value: 'on' | 'off'
Default: 'on'

Version History

Introduced in R2020a