Stop a while loop using a GUI
Mostrar comentarios más antiguos
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.
Respuesta aceptada
Más respuestas (2)
Birkan GOCERLER
el 21 de Sept. de 2014
1 voto
Sean de Wolski
el 24 de En. de 2013
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
Categorías
Más información sobre Interactive Control and Callbacks en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!