Delete Figures except main GUI figure

6 ビュー (過去 30 日間)
Jason
Jason 2016 年 1 月 18 日
コメント済み: Jason 2016 年 1 月 18 日
If I have determined that the following figures open, using
F=findall(0,'type','figure')
figure 1 is my main GUI window.
F =
5x1 Figure array:
Figure (figure1)
Figure (5)
Figure (2)
Figure (3)
Figure (1)
The number of figures open changes and sometimes its just my main GUI (figure1).
How can I delete any figures open EXCEPT figure1
  1 件のコメント
Jason
Jason 2016 年 1 月 18 日
Im guessing I need to delete all except handles.figure1. Not sure how to though

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

採用された回答

Walter Roberson
Walter Roberson 2016 年 1 月 18 日
fig1h = findall(0,'type,'figure','Tag','figure1');
figh = findall(0,'type','figure');
other_figures = setdiff(figh, fig1h);
delete(other_figures);
  1 件のコメント
Jason
Jason 2016 年 1 月 18 日
Perfect, thankyou

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Performance についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by