Sign in

username or email:

password:



Not a member?
Forgot your password?

Search matlab



Search tips

Subscribe to matlab



Ads

Discussion Groups

See Also

Embedded SystemsFPGA

Discussion Groups | Matlab DSP | how to tell if variable is defined

say i type in> > a??? Undefined function or variable 'a'.is there a T/F test for which i can tell whether a var is defined?...

  

Post a new Thread



Is this thread worth a thumbs up?

0

how to tell if variable is defined - toanxtoan - Jul 1 10:04:24 2006

say i type in

>> a
??? Undefined function or variable 'a'.

is there a T/F test for which i can tell whether a var is defined?

______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )

Re: how to tell if variable is defined - Nandan Das - Jul 2 12:32:54 2006

use the command "exist"

Nandan

help exist
 EXIST  Check if variables or functions are defined.
    EXIST('A') returns:
      0 if A does not exist
      1 if A is a variable in the workspace
      2 if A is an M-file on MATLAB's search path.  It also returns 2 when
           A is the full pathname to a file or when A is the name of an
           ordinary file on MATLAB's search path
      3 if A is a MEX- or DLL-file on MATLAB's search path
      4 if A is a MDL-file on MATLAB's search path
      5 if A is a built-in MATLAB function
      6 if A is a P-file on MATLAB's search path
      7 if A is a directory
      8 if A is a Java class

On 6/30/06, toanxtoan <h...@gmail.com> wrote:
>
> say i type in
>
> >> a
> ??? Undefined function or variable 'a'.
>
> is there a T/F test for which i can tell whether a var is defined?
>

______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )