isfield
Returns true if x is a struct and contains the field 'field'.
Syntax
isfield(x, field)
Inputs
- x
- Any valid input.
- field
- Name of field.
Outputs
- R
- Logical equivalent true/false.
Example
Simple isfield example.
s.a=5;
s.b='test';
isfield(s,'a')
isfield(s,'b')
isfield(s,'c')
R = 1
R = 1
R = 0