The wait bar does not close and prevents matlab from closing

18 ビュー (過去 30 日間)
Gabriele Rossi
Gabriele Rossi 2020 年 4 月 26 日
コメント済み: Gabriele Rossi 2020 年 5 月 6 日
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?

回答 (1 件)

Samatha Aleti
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!
  1 件のコメント
Gabriele Rossi
Gabriele Rossi 2020 年 5 月 6 日
Very well, with delete() it works! Thanks!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDialog Boxes についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by