every time you are done debugging. The Live Editor automatically ends the debugging
session when you save.
Step Into Functions
While debugging, you can step into called files, pausing at points where you want to
examine values. To step into a file, click the button directly to the left of the function
you want to step into. You also can use the F11 key to step into a function. The Live
Editor only displays the button if the line contains a call to another function.
By default, the Live Editor only steps into user-defined functions and scripts. To enable
stepping into MathWorks functions as well, on the Home tab, in the Environment
section, click Preferences. Then, select MATLAB > Editor/Debugger, and in the
Debugging in the Live Editor section, clear Only show Step in button for user-
defined functions.
After stepping in, clicking the button at the top of the file runs the rest of the called
function, leaves the called function, and then pauses. You also can use Shift+F11 to step
out of a function.
Examine Variables in the Workspace
When you step into a called function or file, the Live Editor displays the list of the
functions MATLAB executed before pausing at the current line. The list is shown at the
top of the file and displays the functions in order, starting on the left with the first called
script or function, and ending on the right with the current script or function in which
MATLAB is paused. This list is called the function call stack.
For each function in the function call stack, there is a corresponding workspace.
Workspaces contain variables that you create within MATLAB or import from data files or
other programs. Variables that you assign through the Command Window or create using
scripts belong to the base workspace. Variables that you create in a function belong to
their own function workspace.
To examine a variable during debugging, you must first select its workspace. The selected
function in the function call stack indicates the current workspace. To select or change
Debug Code in the Live Editor