Re: variables in workspace




"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


.



Relevant Pages

  • Re: whats a callback?
    ... "Static" referes to local variables that retain their values between ... Static linking of a function (declared in a class ... declaration) means that all instances of that class use the same ... executing concurrently. ...
    (comp.arch.embedded)
  • Re: whats a callback?
    ... "Static" referes to local variables that retain their values between ... Static linking of a function (declared in a class ... declaration) means that all instances of that class use the same ... executing concurrently. ...
    (sci.electronics.design)
  • Re: Wait for an event
    ... "casey" schrieb ... until the user clicks the button, then continue executing the rest ... You will have to use the click event handler. ... Make the local variables available to the whole class. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: how java variables are stored?
    ... >local variables exist only while a method is executing, ... >immediately thrown away. ... Static and instance variables are garbage ...
    (comp.lang.java.programmer)