Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MATLAB settings - stop if errors

I found the "always stop on error (dbstop if error)" to be very useful when I debug MATLAB code.
However, closing matlab also resets it to "Never stop if error"

How can I make this setting persist?

like image 848
Dani Avatar asked Dec 28 '08 17:12

Dani


People also ask

How do you set conditional breakpoints in MATLAB?

To set a conditional breakpoint, right-click the gray area to the left of the executable line where you want to set the breakpoint and select Set Conditional Breakpoint. If a breakpoint already exists on that line, select Set/Modify Condition. In the dialog box that opens, enter a condition and click OK.

How do I exit debug mode in MATLAB?

To exit debug mode, press Alt+B followed by D.

How do you pause in MATLAB?

Typing pause(inf) puts you into an infinite loop. To return to the MATLAB prompt, type Ctrl+C. Example: pause(3) pauses for 3 seconds. Example: pause(5/1000) pauses for 5 milliseconds.


2 Answers

This is the solution indeed - further digging in Mathworks brought up the exact details:

In the default folder typing

edit startup.m

And then writing

dbstop if error



Thanks Schroeder!

like image 141
Dani Avatar answered Nov 11 '22 06:11

Dani


You could use the startup.m file to recreate your settings at startup. See here for more details.

like image 37
cschol Avatar answered Nov 11 '22 06:11

cschol