Resume after Pausing (uicontrol)

조회 수: 3 (최근 30일)
Saad
Saad 2012년 2월 1일
답변: jingxuan yang 2020년 3월 24일
Hi, I have plotted 3 buttons in a figure, 1. one pauses the execution of code, 2. second one should resume the execution (i can resume by pressing any keyboard button but i would like to do this with a button) and 3. third one should exit the loop (end the execution of code). 'break' is not working in this context and for now i have changed the value of loop variable so that condition is no longer met, but that only works for 'while' loop (not for 'for' loops), any better method would be welcome.
uicontrol('Style', 'pushbutton', 'String', 'Pause','Position', [10 10 60 30],'Callback', 'pause');

답변 (2개)

jingxuan yang
jingxuan yang 2020년 3월 24일
use
uiwait
to pause
and use
uiresume
to continue

Sean de Wolski
Sean de Wolski 2012년 2월 1일
This is simple with timers.
doc timer

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by