This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Code Generation Applications

Code Generation Overview

Simscape™ Multibody™ supports code generation through Simulink® Coder™. You can generate C/C++ code from a Simscape Multibody model to accelerate simulation in the Simulink environment or to deploy a model onto external hardware. Model deployment requires an active Simulink Coder license while simulation acceleration does not.

Code Generation Applications

Simulation Acceleration

Simulink can generate C/C++ executable code to shorten simulation time. Two simulation modes rely on code generated from a model:

  • Accelerator

  • Rapid Accelerator

Simscape Multibody supports the two accelerator modes. You can access the simulation accelerator modes in the Simulink Editor window for your model. Click Simulation > Mode, and select Accelerator or Rapid Accelerator. Accelerator modes do not require additional Simulink code generation products.


Simulation accelerator modes do not support model visualization. When you simulate a Simscape Multibody model in Accelerator or Rapid Accelerator modes, Mechanics Explorer does not open with a 3-D display of your model.

Model Deployment

With Simulink Coder, you can generate standalone C/C++ code for deployment outside the Simulink environment. The code replicates the source Simscape Multibody model. You can use the stand-alone code for applications that include:

  • Hardware-In-Loop (HIL) testing

  • Software-In-Loop (SIL) testing

  • Rapid prototyping


Simscape Multibody supports, but does not perform, code generation for model deployment. Code generation for model deployment requires the Simulink Coder product.

Related Topics