MATLAB: Stop a while loop using a GUI function handleguihandlesMATLAB Hey everyone, I need to stop a while loop using a 'Stop' button in a GUI and i was wondering what are the best ways of doing that. Best Answer A short example:h = uicontrol('Style', 'PuchButton', 'String', 'Stop', ... 'Callback', 'delete(gcbo)');while ishandle(h) disp(datestr(now, 0)); pause(0.25);endCheck out the famous 41 GUI example. Related SolutionsMATLAB: How to reset toggle buttons with a push button push buttton callback:set(handles.togglebutton1,'value',0);set(handles.togglebutton2,'value',0); MATLAB: Transfer of information between GUIs Actually it works with waitfor(handles.GUI_B). ;) Related QuestionButton questionSelectionChangeFcn not receiving handlesProblem with togglebutton callbackHow to close a GUI and open another GUI in the callback code
Best Answer