Contenu principal

Additional code

R2026b

Include custom code in the generated model source file

Model Configuration Pane: Code Generation / Custom Code

Description

Specify custom code to include near the top of the generated model source file.

Settings

'' (default) | string

The code generator places code near the top of the generated model.c or model.cpp file, outside of any function.

Tips

To use the same custom code settings as those used for simulation, select Use the same custom code settings as Simulation Target. For more information, see Integrate External Code by Using Model Configuration Parameters.

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

Programmatic Use

Parameter: CustomSourceCode
Type: character vector
Value: C code
Default: ''

Version History

Introduced before R2006a