|
"Dave Lawson" <DaveLawson@Hotmail.com> wrote in message
<fte2jb$13n$1@fred.mathworks.com>...
> I seem to be having a tough time making a simulation
> pause when certain criteria are met. I've tried two
> methods, including using the premade pause block from the
> premades sections. My difficulties seem to be particular
> to executing my simulation from within a .m script.
>
> When I run my script, it launches the simulation.
Things
> work nicely until the condition to pause is it. It then
> outputs a debug message in the matlab console instead of
> pausing anything at all. If I run the simulation via the
> play button in the model viewer, it pauses perfectly.
>
> Is there anyway to force a simulation to pause, if it
is
> being run without the model viewer open?
I have continued digging on this topic, and it seems I'm
only digging a deeper grave.
I've now tried to monitor the values of certain simulation
variables in my script file first matlab sinks in
simulink. Unfortunately, through some sort of quirk, I
have to press CTRL+C during the script's execution, before
ANY of my output values from Simulink are updated. Until I
abort the operation (I assume it is aborting the simulink
simulation when I press that -- I can't honestly tell), my
sinks only show values of 0.
I figured maybe this was because simulink was being greedy
and not releasing any data while the simulation was
ongoing. So, I tried to pause it, and extract the
information while the simulation was pause. This still
gave me only 0's. I then guess that perhaps I had to
terminate the entire simulation (which would in fact defeat
the entire purpose of me doing this), but instead it gives
me a syntax error. I suppose the sinks are no longer in
scope at that point.
Surely someone has tried to monitor a simulation from
within a script! The due date is looming, and I can't find
anything that seems to work for this! Please help!
|