a = isdef(w)
This function checks if a variable is defined. With higher version of Matlab, it has become obsolete, as one can use the Matlab function exist.
The output of Matlab function who.
A string containing the variable name.
An array with 1 if the corresponding variable is defined,0 otherwise.
Pierre Jaccard, Geophysical Institute, University of Bergen, 1999