The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 ]

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" <> wrote in message <c9iknk$s3g$>...
> 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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.