how to enter data to a simulink model while it is executing

I am running my simulink models from gui written in script in MATLAB ,Now i want to change some values of simulink model blocks which are user entering while the starting of the simulation,,but now i want to change them whenever user wants them to change,,,for this i should pause the simualtion or how will i allow user to enter his value at any time

回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2012 年 12 月 10 日

0 投票

If you don't need to change parameters while your model is running, it's better to stop your model. then use set_param function to change your parameters

4 件のコメント

TAB
TAB 2012 年 12 月 10 日
@Arun: And only Tunable Parameters values can be changed while running simulation.
Arun Badigannavar
Arun Badigannavar 2012 年 12 月 10 日
@TAB went through these tunable parameters ,,,thanks for it,,,
Azzi Abdelmalek
Azzi Abdelmalek 2012 年 12 月 10 日
編集済み: Azzi Abdelmalek 2012 年 12 月 10 日
use these commands
set_param('modelname','SimulationCommand','pause')
Then
set_param('modelname/yourblock','param','value')
then
set_param('modelname','SimulationCommand','continue')
If you want to stop simulation use
set_param('ansm269','SimulationCommand','stop')
doc set_param
Arun Badigannavar
Arun Badigannavar 2012 年 12 月 10 日
Thanks @Azzi

この質問は閉じられています。

製品

質問済み:

2012 年 12 月 10 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by