prompt line blocks access to figure

hi
i have this code line:
...
plot(x,y)
prompt = 'Choose a number';
the problem is that i need to look in the plot at some points before using the prompt command. when i use the 'pause' command it also doesn't help because the pause is cancelled after one mouse click
is there an elegant way to solve this?

 채택된 답변

Vishal Rane
Vishal Rane 2013년 6월 13일

0 개 추천

You could add a pushbutton to the plot figure or a dialog box maybe, indicating to the user that they can use that button/dialog box to continue execution when they are done staring at the plot.

댓글 수: 4

noa
noa 2013년 6월 13일
how? :)
Vishal Rane
Vishal Rane 2013년 6월 13일
편집: Vishal Rane 2013년 6월 13일
Use this
h = msgbox('Press OK to proceed');
waitfor(h)
The waitfor function halts further execution till user clicks on OK or closes the msgbox
Refer this waitfor and msgbox
noa
noa 2013년 6월 13일
cool! is there any way I can set the location of where the box pops up?
use this after the msgbox command
set(h,'Position',[400 400 100 50 ]) % [left bottom width height]
Explore more figure properties

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

질문:

noa
2013년 6월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by