Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Pause matlab while the simulation is running?

2,843 views
Skip to first unread message

Jeff Court

unread,
Dec 9, 2009, 4:34:19 PM12/9/09
to
I have a simulation that is running and it takes about 6 hours to do so. Is it possible to pause it while it is running and continue running it later?

I know I can use the 'pause' command in my code, but I am looking for something I can do while the code is running. I know CTRL-c will kill the code, so I don't want to do that. I just want to stop it temporarily.

ImageAnalyst

unread,
Dec 9, 2009, 5:21:43 PM12/9/09
to
Are you using GUIDE or some GUI? Maybe you can setup a keypress event
to pause the process (you'd have to check for that at key locations in
your code.) Often what I do is to have a checkbox that says "Finish
Now." Even if some code is running, it will still let me click on
that checkbox. Then in my code, at the bottom of the loop, I can
check to see if that checkbox is checked. If it is, I break out of
the loop. Maybe something like that can help you - have a checkbox
labeled "Pause". Maybe if it's checked you can just set up a timer
and periodically check the checkbox again and continue with the loop
once they've toggled the checkbox back to it's "run/not paused" state.

Jeff Court

unread,
Dec 10, 2009, 9:22:18 AM12/10/09
to
A pause GUI is an excellent idea! Thank you very much!
0 new messages