The wait bar does not close and prevents matlab from closing

16 vues (au cours des 30 derniers jours)
Gabriele Rossi
Gabriele Rossi le 26 Avr 2020
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?

Réponses (1)

Samatha Aleti
Samatha Aleti le 29 Avr 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!

Catégories

En savoir plus sur Dialog Boxes dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by