How to close mutiple uifigure using command
古いコメントを表示
I run fig = uifigure many time in Matlab,so I genetared lots of uifigure ,I want to close all uifigure with one line of command.Do you know what command I should enter in Matlab.Thank you very much
採用された回答
その他の回答 (2 件)
Just to add another approach,
Set HandleVisibility to on when you create the UIFigures. That way their handles will be visible to gcf() , close all, etc....
uifigure('HandleVisibility', 'on')
5 件のコメント
bo peng
2020 年 10 月 14 日
I2M
2021 年 1 月 4 日
Yes very nice answer because when you move from guide to app it is not easy to uderstand that
Jan Kudlacek
2021 年 12 月 29 日
編集済み: Jan Kudlacek
2021 年 12 月 29 日
In Matlab 2019b HandleVisibility is 'off' and is read only. Is there any workaround?
Adam Danz
2021 年 12 月 29 日
Yang Liu
2023 年 11 月 10 日
I don't konw why but this doesn't work for me... weird...
Bjorn Gustavsson
2020 年 10 月 14 日
If you want to keep some figures you can close a subset of them if you keep the figure-handles in an array. If you modify your creation to something like this for all call to uifigure:
if ~exist('uifig')
uifig = uifigure;
else
uifig(end+1) = uifigure;
end
if ~exist('uifig')
uifig = uifigure;
else
uifig(end+1) = uifigure;
end
% ...etc
% then you can close some suitable set of them, or all of them
% closing all:
close([uifig]),clear uifig
% closing some:
close([uifig([1 3])]),uifig([1 3]) = [];
HTH
カテゴリ
ヘルプ センター および File Exchange で Environment and Settings についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!