How to close msgbox after loop finishes?

Hello All, I need help with msgbox() function. I want it to show at the start of my calculation and then after calculation ends, I need it to close automatically,
So basically I have created GUI where after clicking "calculate" pushbutton, the script runs.
So before the calculation starts I have this:
h=msgbox('Please wait.Calculation in progress...');..
Now I want it to close once the calculation is finished. So after calculations I have added
delete(h);
And I am getting error:
Error using delete
Invalid or deleted object.
I tried with close too but no luck. Please suggest!

댓글 수: 3

TastyPastry
TastyPastry 2016년 6월 8일
It is possible you overwrote h during your calculations and closed it inadvertently.
Geoff Hayes
Geoff Hayes 2016년 6월 8일
adi - have you created this GUI using GUIDE or programmatically? Where do you create the message box (which method) and where do you try to close it?
KAE
KAE 2018년 1월 3일
You may want waitbar instead.

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

답변 (1개)

Walter Roberson
Walter Roberson 2018년 1월 3일

0 개 추천

If you are using R2014b or later, then use
if isvalid(h); delete(h); end

카테고리

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

태그

질문:

2016년 6월 8일

답변:

2018년 1월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by