Re: variables in workspace
- From: "Steven Lord" <slord@xxxxxxxxxxxxx>
- Date: Tue, 4 Sep 2007 12:37:13 -0400
"Farwa Bat" <farwa@xxxxxxxxxxxxx> wrote in message
news:fbju0f$t4m$1@xxxxxxxxxxxxxxxxxxxxx
I want to access the local variables of the function in my
workspace.When the program is executed it clears all the
variables.How i can I see the local variables.
As you've stated what you want to do, you can't. As soon as a function is
finished executing, its workspace is cleared. Anything that you did not
return from the function as an output argument is lost.
There are two ways to see what's in your function workspace when the
function is finished computing. The first is to return the variables you
want to examine as output arguments from your function. If you want to use
variables from one function in another, this is the approach you should
take. The second is to put a KEYBOARD statement as the last line of your
function or a breakpoint on the last line and examine the variables after
the function has finished computing but before the function has finished
executing.
Are you trying to examine the local variables to debug your code? If so, I
recommend that you read through the "Editing and Debugging M-Files" chapter
in the "Desktop Tools and Development Environment" manual included with the
MATLAB documentation.
http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_env/bqrf3v_.html
This will explain how to use the debugging capabilities of the MATLAB Editor
to locate and eliminate bugs in your code.
--
Steve Lord
slord@xxxxxxxxxxxxx
.
- References:
- variables in workspace
- From: Farwa Bat
- variables in workspace
- Prev by Date: Re: Plot a circonference
- Next by Date: Re: Help
- Previous by thread: variables in workspace
- Next by thread: Re: variables in workspace
- Index(es):
Relevant Pages
|