Maybe the pause() function was reimplemented to allow the new pause-simulation feature in R2016a. I am just writing this to get more attention to my question ;(
pause() Matlab to wait for Simulink in R2016a
4 views (last 30 days)
Show older comments
Hi,
I have a Matlab script that resumes a paused Simulink simulation and waits until it pauses again. (Simulink pauses by itself using an Assertion block.) The matlab code I use is
set_param(model,'SimulationCommand','continue');
while true
plantStatus = get_param(model,'SimulationStatus');
if strcmp(plantStatus,'running')
clc
display('waiting for Simulink to pause...')
pause(0.1) %give thread to simulink
elseif strcmp(plantStatus,'paused')
%display('paused by Simulink')
break
end
end
This worked fine on R2015b. On R2016a it seems as the 'while loop' is blocking Simulink from making progress in the simulation. This prevents it from reaching its pause time and therefore the Matlab loop runs forever.
To prevent Matlab from blocking Simulink, the 'pause(0.1)' statement worked before. Was its behavior changed in R2016a? Any ideas how I can fix this again?
Thanks!
2 Comments
Andreas Goser
on 21 Jun 2016
If this is an important topic for you and there is no response in this users help users forum, I suggest you contact Technical Support.
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Programmatic Model Editing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!