Can I use Simulation Pacing with Simulink Compiler?

4 ビュー (過去 30 日間)
MathWorks Support Team
MathWorks Support Team 2021 年 11 月 2 日
編集済み: MathWorks Support Team 2025 年 3 月 21 日
I would like to deploy my model with Simulink Compiler and use the Simulation Pacing feature to slow down the simulation pace to approximately equivalent to wall clock time, or one simulation second per wall clock second.  

採用された回答

MathWorks Support Team
MathWorks Support Team 2025 年 3 月 21 日
編集済み: MathWorks Support Team 2025 年 3 月 21 日

For R2022b and later:

As of R2022b, Simulation pacing is supported in Rapid Accelerator and Simulink Compiler. This setting can be used to run a model in Simulation pacing at a "soft real-time" pace. 

For R2022a and earlier:

If you are using R2022a or earlier, Simulation Pacing is not supported in Rapid Accelerator or Simulink Compiler. You can achieve a similar effect by adding a "pause()" to the postStepFcn of the compiled app to slow the simulation. Attached is an example that shows the basics of this method and controls the pause time using a slider. The "Sim Pacing" display in the app displays the total wall clock time divided by the total simulation time.
This is a simple control scheme that requires manual tuning but you can adapt the example to have the app attempt to tune the pause time automatically to reach a desired simulation rate.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by