Main Content

Include custom code for referenced models


Use custom code for referenced model simulation (SIM) target build for accelerator mode.

Category: Model Referencing


Default: Off


Ignore custom code for model reference accelerator simulation.


Use custom code with Stateflow® or with MATLAB Function blocks during model reference accelerator simulation.


  • Caution

    Using custom code for referenced models in accelerator mode can produce different results than if you simulate the model without using the custom code. If the custom code includes declarations of structures for buses or enumerations, the SIM target generation fails if the build results in duplicate declarations of those structures. Also, if the custom code uses a structure that represents a bus or enumeration, you might get unexpected simulation results.

  • Use the Configuration Parameters > Simulation Target pane to specify the custom code file.

Command-Line Information

Parameter: SupportModelReferenceSimTargetCustomCode
Value: 'on' | 'off'
Default: 'off'

Recommended Settings

DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionOff