I would like to add delay in between two transitions in sim() function. How do I do that ?

1 回表示 (過去 30 日間)
Mitali Gupte
Mitali Gupte 2018 年 11 月 29 日
回答済み: Rishabh Gupta 2018 年 12 月 10 日
I am using following function and I wnat to save output at some specific delay.How to do that?
It will really great if I can get some head start to it.
a = sim(model,'StopTime', num2str(NumberOfTransitions), 'StartTime', '0','SaveOutput','on');

回答 (1 件)

Rishabh Gupta
Rishabh Gupta 2018 年 12 月 10 日
Hi Mitali,
If you know the specific delay after which you need to stop the simulation and save the results, then you could try the following:
  1. Simulate the model untill that simulation time(specific delay in your case).
  2. Save the output
  3. Save the Simulation State using SimState object. Link to the same is attached below.
  4. Reload the simulation state and then run the simulation for rest of the Simulation steps.
Refer to the following documentation to understand how to save and restore a simulation state using SimState object : https://www.mathworks.com/help/simulink/examples/saving-and-restoring-simulation-state-using-simstate.html?s_tid=answers_rc2-1_p4_MLT
I hope this helps.

カテゴリ

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

タグ

製品


リリース

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by