Can I use a button to stop a GUI and the function and the script that started it?
3 次查看(过去 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 中查找有关 Simulink Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!