stateflow one time step ahead sometimes

Hi,
I built a simple system: ramp - display & stateflow with one input. If I run it, the stateflow is one timestep ahead. If I add another output (still an empty stateflow!) the "discrepancy" is gone. (This is probably just an issue how the display is updated.)
But in my actual model the stateflow sees limits exceeded before the controller (mpc) written in matlab embedded reacts. If I put a unit delay to the statespace input it works fine.
But I have the feeling that this is not a good solution.

 采纳的回答

It's a little difficult to understand the issue without a model snapshot (if you'd like to upload one, see http://www.mathworks.com/matlabcentral/answers/7924-where-can-i-upload-images-and-files-for-use-on-matlab-answers), but the behavior may be due to the block execution order. See Controlling and Displaying the Sorted Order.

1 个评论

It turned out to be a bug... I guess. When I newly build up the system from an early version without this problem, it was gone. But thank you anyway, it is a nice tool!

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Stateflow 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by