Stop a while loop using a GUI
이전 댓글 표시
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.
채택된 답변
추가 답변 (2개)
Birkan GOCERLER
2014년 9월 21일
1 개 추천
Sean de Wolski
2013년 1월 24일
Have the while-loop check if a togglebutton uicontrol has been pushed (i.e. what is it's value). If it has the loop will end
while(get(handles.togglebutton,'value')); %handles.togglebutton is handle to button
do_stuff;
drawnow; %force event queue update
end
카테고리
도움말 센터 및 File Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!