The wait bar does not close and prevents matlab from closing
18 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
回答(1 个)
Samatha Aleti
2020-4-29
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!
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dialog Boxes 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!