GUI- "Attempt to reference field of non-structure array." Error with varargout and using red x to close
Mostrar comentarios más antiguos
A similar question was already asked but the link to the solution ( http://www.mathworks.com/support/solutions/data/1-193LD.html?solution=1-193LD ) has expired I think because I can't view it so I figured I would ask it again since similar questions don't seem to relate to varargout:
Error using waitfor Error while evaluating uicontrol Callback
Attempt to reference field of non-structure array.
Error in SaveMethod>SaveMethod_OutputFcn (line 207) varargout{1} = handles.output;
Error in gui_mainfcn (line 263) [varargout{1:nargout}] = feval(gui_State.gui_OutputFcn, gui_hFigure, [], gui_Handles);
Error in SaveMethod (line 40) [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
I get the error when I try to close my GUI window with the red x in the corner (as opposed to a back button I usually use to close). I also tried to include a uiwait in my opening and then uiresume in my output functions but I still got the same error.
Any solutions?
P.S. This is my outputfcn: varargout{1} = handles.output; set(handles.figure1,'Visible','off')
2 comentarios
Geoff Hayes
el 10 de Jul. de 2014
Megna - the error attempt to reference field of non-structure array in this case means that the handles structure is not considered a structure (it has no fields) and is probably empty. If you were to put a breakpoint at this line and run the GUI, you could see if that were the case.
Have you made any changes to the yourGuiName_OpeningFcn or to the code that initializes the GUI?
How do you run the GUI - from the Command Window or from within GUIDE?
Why, in the yourGuiName_OutputFcn, do you invoke the line
set(handles.figure1,'Visible','off')
It may help to attach your m file and fig file to your question so that someone else can run it and see if they can reproduce your behaviour.
Megna Hari
el 10 de Jul. de 2014
Editada: Megna Hari
el 10 de Jul. de 2014
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Whos en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!