Can I use a button to stop a GUI and the function and the script that started it?
1 回表示 (過去 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!