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 ]
Guest

Watch Watch this User
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

"Steven Lord" <slord@mathworks.com> wrote in message <c9iknk$s3g$1@fred.mathworks.com>...
> Guillaume wrote:
> > Sorry, I answered my own question and this is quite frustrating. This
> > is from Solution Number: 1-1BSWG.
> >

> >> In MATLAB 6.1 (R12.1), ^c will break the loop and execute the catch
> >> block. In MATLAB 6.5 (R13), the catch block will not execute.
> >>
> >> Solution:
> >>
> >> TRY/CATCH no longer catches Ctrl-C interruptions as of MATLAB 6.5
> >> (R13). This change in behavior was intentional. There are no known
> >> workarounds for reverting to the previous behavior.

> >
> > So is there another way to get Matlab to, for example, pass
> > intermediate results from a while loop, after hitting ctrl-c, to a
> > function output?



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.



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.