The wait bar does not close and prevents matlab from closing

17 visualizzazioni (ultimi 30 giorni)
Good evening, I created a program that uses a waitbar in a function, defined as follows:
F = waitbar(0,"1",'Name',"Calcolo cinematica inversa");
for u = 1:count
...
if getappdata(F,'canceling')
close(F);
return;
end
waitbar( u/count,F, sprintf('Calcolo %d di %d.',u,count) );
end
close(F);
the problem is that the close (F) function does not cause the waitbar to close, which remains open. The window showing the waitbar cannot be closed in any way except by restarting matlab, which in this situation can only be closed by forcing it to stop. Matlab continues to work correctly in all other functions and the program can be launched again causing the appearance of a new waitbar which, too, cannot be made to disappear. Has this happened to anyone?

Risposte (1)

Samatha Aleti
Samatha Aleti il 29 Apr 2020
Hi,
Generally, this type of behaviour occurs when you have Cancel button added to your "waitbar" and trying to remove the wait bar box using “close(). In such cases, you must use “delete ()” instead of “close ()” to remove the wait bar dialogue box.
Hope this helps!

Categorie

Scopri di più su Dialog Boxes in Help Center e File Exchange

Prodotti


Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by