Debugging in Matlab/Octave

From GHER

Revision as of 09:28, 20 February 2013 by WikiSysop (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Matlab Octave
Stop on error dbstop on error debug_on_error(1)
Disable stop on error dbclear all debug_on_error(0)


Commands common to Matlab and Octave

dbstop
Add a breakpoint.
dbclear
Remove a breakpoint.
dbstatus
List all breakpoints.
dbwhere
Report the current file and line number where execution is stopped.
dbtype
List the function where execution is currently stopped, enumerating the line numbers.
dbstep, dbnext
Execute (step) one or more lines, follow execution into (step into) a function call, or execute until the end of a function (step out), and re-enter debug mode. Debug mode equally allows single line stepping through a function using the commands dbstep and dbnext. These differ slightly in the way they treat the next executable line if the next line itself is a function defined in an m-file. The dbnext command will execute the next line, while staying in the existing function being debugged. The dbstep command will step in to the new function.
dbcont
Continue normal code execution from the debug prompt.
dbquit
Quit debugging mode immediately and return to the main prompt.
dbstack
Print a backtrace of the execution stack.
dbup
Move up the execution stack.
dbdown
Move down the execution stack.
keyboard
Force entry into debug mode from an m-file.

see help debug in octave

Personal tools