MATLAB: Check if a variable in a structure exist

existguistructurevvariable

Hello, I must check if the variable handles.Y2 exists in the structure handles(I work with gui). Using exist gives me 0 although it exist in the structure thanks

Best Answer

isfield(handles,'Y2')
doc isfield % for details
help struct % for reminder on structures