Closing GUI without error
이전 댓글 표시
In my GUI I have a simulation that runs with a while loop. Problem is when I close the window while it's still running, matlab gives me an error message of the sort:
Error using matlab.ui.control.UIControl/get
Invalid or deleted object.
Error in SPCgui>startrestart_Callback (line 376)
if get(handles.pauseresume,'Value')==1
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in SPCgui (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)SPCgui('startrestart_Callback',hObject,eventdata,gu idata(hObject))
Error while evaluating DestroyedObject Callback
Is there a way to force a loop to stop when I close the window so that this error doesn't occur? I tried using figure1_DeleteFcn and figure1_CloseRequestFcn to no avail.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!