Can I use a button to stop a GUI and the function and the script that started it?
조회 수: 4 (최근 30일)
이전 댓글 표시
Hello I'm sorry if there is an answer out there but I haven't been able to find it. I have a script which runs a script which calls a function which launches a GUI. Is it possible to have a button in the GUI that will exit the GUI, the function, and the script (basically an abort button)?
To exit the GUI I have: delete(handles.figure1) return;
but it seems that "return" runs the gui exit code because I get the following error when I hit the button:
??? Attempt to reference field of non-structure array.
Error in ==> a2_QueryLoopGUI>a2_QueryLoopGUI_OutputFcn at 74
varargout{1} = handles.output;
Any ideas? Do I have to pass an exit variable out through varargout to the function and then from the function into the script?
Thanks!
댓글 수: 0
답변 (1개)
Sean de Wolski
2012년 3월 29일
Sure.
Have the GUI, on exit by pushing a quit button (or the red 'x'), return a flag that when returned, is checked for in the function, which return from the function etc.
Or just have it throw an error.
댓글 수: 3
참고 항목
카테고리
Help Center 및 File Exchange에서 Environment and Settings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!