dbstep
Execute next executable line during debugging.
📝Syntax
dbstep
dbstep in
dbstep out
dbstep nlines
📥Input Arguments
Parameter Description
nlines Positive integer specifying the number of executable lines to step. Execution pauses at breakpoints encountered along the way.
📄Description

dbstep executes the next executable line of the current file during debugging, skipping breakpoints in functions called by that line.

dbstep in steps into any function called on the current line, pausing at the first executable line of the called function.

dbstep out completes execution of the current function and pauses just after returning to the caller. Execution pauses at any breakpoint encountered along the way.

dbstep nlines executes the specified number of lines, pausing at any breakpoint encountered.

These commands can only be used from the command line while debugging.

💡Examples
Step over a called function.
function n = myfile(x)
  n = myfunction(x-1);
end

function z = myfunction(y)
  z = 2/y;
end

dbstop in myfile
myfile(2);
dbstep
Step into a called function.
dbstop in myfile
myfile(2);
dbstep in
Step out of the current function.
dbstep out
Step multiple lines in one command.
dbstep 4
🔗See Also
dbstopdbcontdbquitdbstatusdbstack
🕔Version History
Version Description
1.16.0 initial version
Edit this page on GitHub