Continue code if Message box OK is pressed

11 次查看(过去 30 天)
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.

回答(3 个)

Abdul Asad
Abdul Asad 2017-4-20
I am getting this error
Undefined function or variable 'AutoWarnDlg'.

Abdul Asad
Abdul Asad 2017-4-20
I am using matlab 2016

Jan
Jan 2017-4-20
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

类别

Help CenterFile Exchange 中查找有关 Downloads 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by