step by step simulation in command line for simulink model
4 ビュー (過去 30 日間)
古いコメントを表示
Hi I just want some urgent solution for command line implementation for simulink. In simulink model there is simulation switch called "step forward". With this I am able to run step by step and able to see the outputs in scope for each sample time. I am also able to change some inputs for constant input blocks at any sample period time. However, I want to do this in command line, because I have a huge model and I want to reuse this model verification script. I am able to do some thing like this using "sim" command. But the sim command is just simulating the entire model at once, and I could not observe/change the intermediate outputs/inputs. The "sim" command with a certain stop time is running for certain sample periods, but later if I give the next "sim" command, it is running from the beginning and not starting from where it stopped. But, is there any exact matlab command to step and pause (for one sample period time) the simulation, like that in simulink gui.
回答 (2 件)
TAB
2015 年 4 月 7 日
Use "step" command in debug mode
>> sim('model', 'debug', 'on');
%----------------------------------------------------------------%
[TM = 0 ] model.Simulate
(sldebug @0): >> step in
%----------------------------------------------------------------%
[TM = 0 ] model.Start
(sldebug @1): >> step in
%----------------------------------------------------------------%
.... so on
0 件のコメント
abc NP
2015 年 4 月 7 日
1 件のコメント
TAB
2015 年 4 月 8 日
As far as I know, it is not possible to debug model from script or function. Debug command are to be entered in debug prompt which is available in command window only.
"ToWorkspace" data is updated at the end of simulation only.
You can change any tunnable parameter during simulation, also while debugging.
参考
カテゴリ
Help Center および File Exchange で Debug Simulations Programmatically についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!