I have a simulink model which i am controlling from Matlab engine in C++ application. i start the simulation by using command set_param("mySimulinkModel","SimulationCommand","start"). now my requirement is the run the simulink model only for given simulation time (timeStep), once the simulation exceed the given simulation time step it should be paused.
how can i setup my model to run it only for given simulation time step?

 採用された回答

Mischa Kim
Mischa Kim 2014 年 2 月 5 日
編集済み: Mischa Kim 2014 年 2 月 5 日

0 投票

Bhawesh, you mean, you would like to set the simulation stop time? This is done using
set_param('mySimulinkModel','StartTime','5','StopTime','100')
showing also start time set up. For a complete list of model parameters check out the documentation.

3 件のコメント

Bhawesh Kumar
Bhawesh Kumar 2014 年 2 月 5 日
no i don't want to stop the simulation but pause it. and after updating some variable i will resume it again and keep repeating the process.
Mischa Kim
Mischa Kim 2014 年 2 月 5 日
All right, then simply use
set_param('mySimulinkModel','SimulationCommand','pause')
and 'continue' to do so with some logic. See documentation for more info.
Saurabh Suresh Jambotkar
Saurabh Suresh Jambotkar 2019 年 10 月 22 日
thanks @ Mischa Kim
worked nicely

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by