
MATLAB Workspace
Viewing Base and
Function Workspaces Using the
Stack
When you run M-fi
les, MATLAB a ssigns each function its own w orkspace,
called the funct
ion workspace, which is sep a rate f rom the MATLAB b as e
workspace. To a
ccess the base and function workspaces when running or
debugging M -fi
les, use the Stack field in the Workspace browser. The Stack
field is only a
vailable in debug mode and o therwise is grayed out. The Stack
field is also a
ccessible from the Array Editor and the Editor/Debugger. See
“Finding Erro
rs, Debugging, and Correcting M-Files” on page 6-84for more
information.
See also the
dbstack and evalin functions.
Creating Plo
ts from the Workspace Browser
From the Work
space browser, you can generate a plot of a variable. To create
aplot,click
the Plot button
on the Workspace browser toolbar and select
the plot type
. The plot appears in a figure window. The button itself changes
to reflect t
he currently selected style of plot, for example bar or stem.
This featur
e is only available for variables whose data types can be plotted,
such as nume
ric. Open the variable in the Array Editor for additional plotting
options.
In addition
, you can right-click the variable you want to plot. From the
context me
nu, cho ose the type of plot you want to create.
You can als
o Shift+click or Ctrl+click to select multiple variables to plot
together.
When one of the variables is named
time, t,orT, MATLAB assumes
it is the i
ndependent variable.
For more i
nformation about creatinggraphsinMATLAB,seetheMATLAB
Graphics
documentation.
Opening V
ariables and Objects for Viewing and
Editing
In the Wor
kspace browser, double-click a variable and it opens in the Array
Editor,
where you can view and edit the contents of the variable. See “Viewing
and Edit
ing Workspace Variables with the A rray Editor” on page 5-12 for
more inf
ormation about opening arrays.
5-9
Commentaires sur ces manuels