rn14
Structural
- Aug 30, 2006
- 79
I have a problem with a GUI I have been working on (generated with GUIDE). In one function I assign a value to a variable and then put it in the handles structure and update it...
units_x = 'in';
handles.units_x = units_x;
guidata(hObject, handles);
but when I try and use handles.units_x in a later function Matlab tells me field units_x does not exist. I managed to get the first function to pass the handles by making it an output of the function
like this...
[x y handles] = function whateva(hObject, handles)
It works but it seems like I should have to do it this way,
especially since this is the only function in which I have had to pass the handles this way.
Thanks for any help.
units_x = 'in';
handles.units_x = units_x;
guidata(hObject, handles);
but when I try and use handles.units_x in a later function Matlab tells me field units_x does not exist. I managed to get the first function to pass the handles by making it an output of the function
like this...
[x y handles] = function whateva(hObject, handles)
It works but it seems like I should have to do it this way,
especially since this is the only function in which I have had to pass the handles this way.
Thanks for any help.