필터 지우기
필터 지우기

how to stop in Gui

조회 수: 2 (최근 30일)
Feng
Feng 2011년 10월 5일
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?

답변 (2개)

Walter Roberson
Walter Roberson 2011년 10월 5일
You would have to set a value somewhere that the subroutine periodically checked and exited if the value so indicated.
  댓글 수: 2
Feng
Feng 2011년 10월 5일
Thanks for asnser my question.
I guess that is my chanllenge. I am not sure how a stand alone subroutine, or a function I should say, can interact with a GUI action.
Thanks,
Sean de Wolski
Sean de Wolski 2011년 10월 5일
if (stop_button.value) %if button pushed
break;
end

댓글을 달려면 로그인하십시오.


Sean de Wolski
Sean de Wolski 2011년 10월 5일
Sounds like you want to use a timer:
doc timer
  댓글 수: 2
Walter Roberson
Walter Roberson 2011년 10월 5일
Not sure how a timer would assist when it is a matter of a stop *button* ?
Sean de Wolski
Sean de Wolski 2011년 10월 5일
Stop button stops the timer.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by