How to change a block's parameter in a pause and make it affect the simulation straight away?
2 次查看(过去 30 天)
显示 更早的评论
Hi,
I try to control the simulink simulation flow from a script. There is a constant block in my blockdiagram, which I would like to change its value at each sampling instance.
Here is the algorithm I use:
At each sampling instant k an assertion block in Simulink sets the 'SimulationCommand' to 'pause' so that the simulink blockdiagram pauses at time k. Then, the script sets the value parameter of the constant block which samples at Ts, updates and continues the flow.
Every thing is Okey but that the change to the value of the block does not take effect instantly. It actually influences the simulation since the next sampling instance that is k + Ts.
I look for ways to make the change affect the simulation instantly. Please advise if you think you have an idea.
By the way, I tried to update the diagram after each usage of 'set-param' command but it seems that it has no effect on the block's state.
Thank you,
Pouya
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sources 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!