
Debugging Process a nd Features
that line and select the action. MATLAB prompts you to specify the exact
breakpoint on which to act in that line.
When you set a breakpoint in an anonymous function, MATLAB stops when
the anonymous function is called. The following illustration shows the
Editor/Debugger when you set a breakpoint in the anonymous function
sqr in
line 2, and then run the file. MATLAB stops when it runs
sqr in line 4. After
youcontinueexecution,MATLABstopsagainwhenitruns
sqr the second
time in line 4. Note that the Stack display shows the anonymous function.
Error Breakpoints
Set error breakpoints to stop prog ram execution and enter debug mode when
MATLAB encounters a problem. Unlike standard and conditional breakpoints,
you do not set these breakpoints at a specific line in a specific file. Rather,
once set, MATLAB stops at any line in any file when the error condition
specified via the error breakpoint occurs. MATLAB then enters debug mode
andopensthefilecontainingtheerror, with the pause indicator at the line
containing the error. Files open only when the you select Debug > Open
M-Files . Error breakpoints remain in effect until you clear them or until you
end the MATLAB session. You can set error breakpoints from the Debug
menu in any desktop tool. This section covers the following topics:
• “Setting Error B reakpoints” on page 6-130
• “Error Breakpoint Types and Options” on page 6-130
6-129
Comentários a estes Manuais