Stepping through sorted order of Simulink model

2 次查看(过去 30 天)
I have a Simulink model that may be executing blocks in a different order than I expect. So, I would like to check the order that the blocks are executed. The information returned by Format > Block Displays > Sort Order is not intuitive. I would prefer to "step" through the model and highlight each block as it is being executed, pulling up whatever subsystem that the block resides in. I don't need to go through the entire simulation; just a couple of loops through should be enough.
Is it possible to step through blocks in their order of execution?

采纳的回答

Kaustubha Govind
Kaustubha Govind 2012-3-16
Yes, you can do that with the Simulink Debugger.
  2 个评论
K E
K E 2012-3-19
Thanks, very helpful. I learned that it is possible to list the sort order of blocks as follows,
sldebug 'myModelNameNoExtension'
slist
And then you can highlight the relevant block using
hilite_system('nameOfBlockFromSlist', 'find')
if you manually cut & paste in one of the block names that slist outputs.
K E
K E 2012-3-19
How to step through the blocks with the debugger, in case it is useful to another beginner,
* Open model and load any workspace variables
* Tools > Simulink Debugger
* 'Play' button to start simulation (will stop at first block)
* 'Go to the next block method' button (2 squares) to step forward one block
* Or, choose 'Animate' button then 'Play' button to see blocks executed in order. Unfortunately, will not open up the subsystems as they are executed.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Modeling 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by