Installation guide
Debugging Process a nd Features
Errors. When an error occurs, execution stops, unless the error is in a
try...catch block. MATLAB enters debug mode and opens the M-file to
thelineinthe
try portion of the block that produced the error. You cannot
resume execution.
Try/Catch Errors. When an error occurs in a
try...catch block, execution
pauses. MATLAB enters debug mode and opens the M-file to the line that
produced the error. You can resume execution or use debugging features.
Warnings. When a warning is produced, MATLAB pauses, enters debug
mode, and opens the M-file, paused at the line that produced the warning.
Yo u can resume execution or use debugging features.
NaN or Inf. When an operator, function call, or scalar assignment pro duces
a
NaN (n ot-a-num ber) or Inf (infinite) value, MATLAB pauses, enters
debug m ode, and opens the M-file, paused immediately after the line that
encountered the value. You can resume e xecution or use debugging features.
Use Messag e Identifiers. Execution stops only when MATLAB enco unters
one of the specified errors. This option is not available for the NaN or Inf
type of error breakpoint. To use this feature:
1 Select the Errors, Try/Catch Errors, or Warnings tab.
2 Select the Use Message Identifiers optio n.
3 Click Add.
4 In the resulting Add Message Identifier di alog box, supp ly the mess ag e
identifier of the specific error you want to stop for, where the identifier is
of the form
component:message,andclickOK.
5 The message identifier y ou added appears in the Stop If Errors/Warnings
for All Files dialog box, where y ou click OK.
You can add multiple mes sag e identifiers, and edit or remove them.
One way to obtain an error message identifier generated by a MATLAB
function for example, is to produce the error, and then run the
lasterror
function. MATLAB returns the error m essage and identifier. Copy the
identifier from the Command Window output and paste it into the Add
6-131