Path: news.mathworks.com!not-for-mail
From: "Steven Lord" <slord@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Error lands in debugger instead?
Date: Tue, 9 Oct 2007 10:13:11 -0400
Organization: The MathWorks, Inc.
Lines: 28
Message-ID: <feg29n$ag6$1@fred.mathworks.com>
References: <feg1fq$ptf$1@fred.mathworks.com>
Reply-To: "Steven Lord" <slord@mathworks.com>
NNTP-Posting-Host: lords.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1191939191 10758 144.212.105.187 (9 Oct 2007 14:13:11 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 9 Oct 2007 14:13:11 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
Xref: news.mathworks.com comp.soft-sys.matlab:432008




"Fred Sigworth" <fsigworth@mac.com> wrote in message 
news:feg1fq$ptf$1@fred.mathworks.com...
> Is there a better way to debug code?  I run my program, and it halts with 
> an
> error.  Then I click on the error statement, go to the editor, set a 
> breakpoint,
> and run the program again, this time to halt it so I can look at the 
> variables.
>
> Why can't a fatal error put me directly into the debugger, as if the 
> program
> encountered a breakpoint?  Then I could select which stack frame I wanted, 
> and
> look at the variables directly.

Look at "Error Breakpoints" on this page:

http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/matlab_env/bq4hw4g-1.html

If you want to enable this behavior at startup, use DBSTOP in your startup.m 
file as described in the last paragraph on that page.

-- 
Steve Lord
slord@mathworks.com