Continue code if Message box OK is pressed

I have a code in which during middle of the code i have a message box. I want to continue the code only if the user clicks OK to that, otherwise abort the code. i donot want to use 'YES/NO' dialogue.

댓글 수: 1

Jan
Jan 2017년 4월 20일
And what should happen if the user does not press the button? Nothing?

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

답변 (3개)

Abdul Asad
Abdul Asad 2017년 4월 20일

1 개 추천

I am getting this error
Undefined function or variable 'AutoWarnDlg'.

댓글 수: 1

Jan
Jan 2017년 4월 24일
I've posted the link to the FileExchange, where you can download this function for free. Again and with full link: https://www.mathworks.com/matlabcentral/fileexchange/24871-autowarndlg

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

Abdul Asad
Abdul Asad 2017년 4월 20일

1 개 추천

I am using matlab 2016
Jan
Jan 2017년 4월 20일

0 개 추천

See as example FEX: AutoWarnDlg:
Opt.Delay = 15;
Opt.Button = {'Ok'}; % 1st is default
[Reply, TimeOut] = AutoWarnDlg({'Question', 'Press Ok to proceed'}, 'Question', Opt);
if ~TimeOut % Dialog closed by time out ==> User did not press Ok:
return;
end

카테고리

도움말 센터File Exchange에서 Downloads에 대해 자세히 알아보기

태그

질문:

2017년 4월 20일

댓글:

Jan
2017년 4월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by