Main Content

Language

C or C++ code generation for simulation targets

Model Configuration Pane: Simulation Target

Description

Specify C or C++ code generation for simulation targets. This configuration parameter affects:

  • Model reference simulation targets.

  • Rapid accelerator simulation targets.

  • Custom code you implement with C Function blocks, C Caller blocks, MATLAB Function blocks, MATLAB System blocks, and Stateflow® charts. If Import custom code is selected, available custom code variables and functions are parsed.

The Simulation cache folder configuration parameter determines where to save the generated C or C++ files.

Category: Simulation Target

Settings

off (default) | on
on

Enables simulation acceleration by using GPU Coder™. When this option is on, the software generates CUDA® MATLAB® executable (MEX) code from the block and dynamically links the generated code to Simulink® during simulation.

off

Disables simulation acceleration by using GPU Coder.

Recommended Settings

ApplicationSetting
DebuggingOn
TraceabilityNo impact
EfficiencyNo impact
Safety precautionOn

Programmatic Use

Parameter: SimTargetLang
Type: string | character vector
Value: "on" | "off"
Default: "off"

Version History

Introduced in R2020b