[Index for tmp_for_tar/struct] [Return to Master Index]

isfield

(tmp_for_tar/struct/isfield.m)


Function Synopsis

y = isfield(x,k)

Help text

       y = isfield(x,k)

 Returns 1 if x is a struct and k a string, and x.k exists.
 Returns 0 otherwise. 

 For m****b compat and flexibility.

 See also cmpstruct, fields, setfield, rmfield, getfield, isstruct,
 struct. 

 Last modified: January 2000



Listing of function file tmp_for_tar/struct/isfield.m

##       y = isfield(x,k)
##
## Returns 1 if x is a struct and k a string, and x.k exists.
## Returns 0 otherwise. 
##
## For m****b compat and flexibility.
##
## See also cmpstruct, fields, setfield, rmfield, getfield, isstruct,
## struct. 

## Author:        Etienne Grossmann  <etienne@isr.ist.utl.pt>
## Last modified: January 2000

function y = isfield(x,k)
  if is_struct(x)
    y = struct_contains (x, k);  
    ## eval(sprintf('x.%s;y=1;',k),'y=0;');
  else
    y = 0 ;
  end
end

Produced by oct2html on Wed Aug 8 19:47:02 2001
Cross-Directory links are: ON