Start simulink simulation from cetrain time

Dear all,
I start simulink simulation multiple time (with clear mex inbetween) and I want to set simulation start time, so that it advances with each simulation.
i.e.
out=sim('mysim','StartTime','100','StopTime','130')
But this start time sims to be ignored.ssGetTime sims to return values starting from 0.
Is it possible to set start simulation time somehow?
Thanks

 採用された回答

Fangjun Jiang
Fangjun Jiang 2020 年 8 月 26 日

0 投票

See these
set_param('vdp','SimulationCommand','start')
set_param('vdp','SimulationCommand','pause')
set_param('vdp','SimulationCommand','continue')
set_param('vdp','SimulationCommand','stop')

3 件のコメント

Lila Lotus
Lila Lotus 2020 年 8 月 26 日
Thank you for your answer but it is not exactly what i want.
I have already look in those functions. But still have no solution.
I want the start time is for example 30 and not 0 (without simulation from 0 to 30). This really makes sence in my case. But so far I can only start simulation from 0 or continue it.
Fangjun Jiang
Fangjun Jiang 2020 年 8 月 27 日
Open the example model 'vdp', press Ctrl+E, go to Data Import/Export, check to output time as "tout", run
a=sim('vdp','StartTime','30','StopTime','50')
check the value of a.tout. It shows time from 30 to 50.
Can you verify?
Lila Lotus
Lila Lotus 2020 年 8 月 28 日
Yes, It worked. Thanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSimulink についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by