messagebox

25 views (last 30 days)
mohd
mohd on 3 May 2012
Commented: Asal Barak on 12 Dec 2013
hi there, how to close all the messagebox automatically using matlab code.
  1 Comment
Jan
Jan on 3 May 2012
What does "automatically" mean? After a certain period of time? Would closing all figure windows solve your problem, or do you need to keep all non-messagebox figures open?

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 3 May 2012
This seemed to work for me
h=msgbox('Click OK');
close(h);
You can put the close() in a timer callback if you want to close it after a certain time. But check that h exists (see the FAQ for methods). http://matlab.wikia.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.28s.29.3F

More Answers (2)

Ilham Hardy
Ilham Hardy on 3 May 2012
close all ??

Asal Barak
Asal Barak on 10 Dec 2013
h=msgbox('Are you sure you want to delete this file?'); pause(2) close(h)
After 2 seconds your box will be closed. You can change the time to whatever you are intending to.
  2 Comments
Image Analyst
Image Analyst on 10 Dec 2013
Unlike using a timer, this pause method will lock up the program during that time so the user will not be able to interact with anything else. It will not even continue if the user clicks OK immediately - it will still have to wait for the pause to finish.
Asal Barak
Asal Barak on 12 Dec 2013
Thank you

Sign in to comment.

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!