how to stop in Gui
Ältere Kommentare anzeigen
I am running a subroutine of controlling the movement of a stage from one place to another. I like to install a 'stop' button in GUI so I can stop the movement anytime I want.
Is there any way I can do it without breaking the subroutine, namely writing the steps of the subrountine into the program itself?
Antworten (2)
Walter Roberson
am 5 Okt. 2011
0 Stimmen
You would have to set a value somewhere that the subroutine periodically checked and exited if the value so indicated.
2 Kommentare
Feng
am 5 Okt. 2011
Sean de Wolski
am 5 Okt. 2011
if (stop_button.value) %if button pushed
break;
end
Sean de Wolski
am 5 Okt. 2011
Sounds like you want to use a timer:
doc timer
2 Kommentare
Walter Roberson
am 5 Okt. 2011
Not sure how a timer would assist when it is a matter of a stop *button* ?
Sean de Wolski
am 5 Okt. 2011
Stop button stops the timer.
Kategorien
Mehr zu Just for fun finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!