Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: try catch /ctrl-c behaviour
Replies: 4   Last Post: Feb 25, 2014 4:17 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Nasser Abbasi

Posts: 5,663
Registered: 2/7/05
Re: try catch /ctrl-c behaviour
Posted: Apr 5, 2013 5:49 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 4/5/2013 4:27 AM, Peeyush wrote:

>
> Continuing in the same vein, what if I want to stop the execution
>of a long loop before it's termination condition? and I still want to carry
>out some processing on a partially analyzed dataset? Currently, ctrl-c breaks
>the loop and I lose the intermediate results....
>
> I'm running Matlab 12 on a Mac.
>


You have to add your own logic. For example, Make a button and
in the callback set a flag that the main loop checks on at the
end of each iteration. When the main loop detects this flag is set to
terminate, then it can cleanly terminate and do any other
intermediate work.

--Nasser





Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.