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: debug... stop if errors or warnings
Replies: 2   Last Post: Nov 2, 2012 12:13 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Steven Lord

Posts: 18,038
Registered: 12/7/04
Re: debug... stop if errors or warnings
Posted: Nov 2, 2012 9:50 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Nick " <> wrote in message
> In the debug menu under stop if errors or warnings there is an option
> "Use message identifiers (dbstop if error messageid)"
> I would like instead to dbstop at all errors EXCEPT a certain one,
> particularly MATLAB:MEX:genericFailure as it is quite annoying to manually
> have to exit debug mode whenever i get compiler errors

I don't know of a way to do that.

If you're attempting to create a MEX-file and if it's acceptable for that
process to fail in your application, wrap your MEX call in a TRY/CATCH
block. If the caught error's identifier is MATLAB:MEX:genericFailure, simply
continue on with your work; if it is not, RETHROW it, somewhat like the
first example on the TRY/CATCH documentation page.

However I would question whether or not it's acceptable for the MEX-file to
fail to be compiled. MATLAB in general doesn't throw errors "just because."
Errors are like pain to a human body; they're an indication of a larger
problem, meant to draw your attention so you can fix the problem.

Steve Lord
To contact Technical Support use the Contact Us link on

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.