フィルターのクリア

Slow down simulation speed via app

5 ビュー (過去 30 日間)
Johannes
Johannes 2023 年 8 月 21 日
回答済み: Ramtej 2023 年 8 月 28 日
Hi,
I'm using an App as a graphical interface to visualize my simulations results on runtime. I'm also starting the simulation through the App with the sim command. Is there a way to slow down or speed up the simulation while running through a slider in the app(like the one from simulation pacing in simulink)?

回答 (1 件)

Ramtej
Ramtej 2023 年 8 月 28 日
Hi Johannes,
I understand that you are trying to set Simulation pacing through a slider in the app.
You can leverage the below commands for the same.
% First enable Simulation Pacing using set_param or simOptions
set_param(model, 'EnablePacing', 'on');
% In the callback function of the slider, retrieve the value of the slider
% and use it to adjust the simulation pacing as per your requirement
set_param(model, 'PacingRate', value); % value is a finite positive integer
Hope this helps!

カテゴリ

Help Center および File ExchangeCreate Apps to Control Simulations についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by