Info

This question is closed. Reopen it to edit or answer.

Attempt to reference field of non structure array and UIcontrol callback error

1 view (last 30 days)
i have two M-figures. the first one is INITIAL and the second one is INPICA, the first contains radio buttons which upon selecting open the INPICA figure. if i run only the INPICA, there is no error. if I run the INITIAL first and then the INPICA, then this error shows up. where might the error be?
??? Attempt to reference field of non-structure array.
Error in ==> inpica>pushbutton2_Callback at 89 imshow(I, 'parent', handles.axes1)
Error in ==> gui_mainfcn at 96 feval(varargin{:});
Error in ==> inpica at 42 gui_mainfcn(gui_State, varargin{:});
Error in ==> guidemfile>@(hObject,eventdata)inpica('pushbutton2_Callback',hObject,eventdata,guidata(hObject))
??? Error while evaluating uicontrol Callback

Answers (1)

Image Analyst
Image Analyst on 28 Dec 2014
Chances are, you have a "clear" or "clearvars" or "clear all" in your callback. Get rid of that line.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!