Hello,
Does anyone know if it is possible to close all output figures while closing any of them once?
At the moment I am using this:
set(h2, 'HandleVisibility', 'off');
uiwait(msgbox('Click OK to close all '));
close all;
set(h2, 'HandleVisibility', 'on');
This works as automatically asking to close all dialogs. I need it without dialog box and with normal clicking on X at the upper left of a figure.

댓글 수: 3

Adam
Adam 2018년 10월 4일
You can set the 'DeleteFcn' of a figure to be any function handle you want so you can put 'Close All' in this if you want or keep track of a bunch of figure handles that it should close.
It's hard to think of a scenario in which automatically closing any figure which happens to be open, when you close one, is a good idea, rather than having kept track of specific figure handles in an array, which you want to be closed in such a case.
Stephen23
Stephen23 2018년 10월 4일
편집: Stephen23 2018년 10월 4일
I agree with Adam: this sounds like the GUI equivalent of putting clear, clc, and close at the top of every script. Rather than indiscriminately closing everything, keeping track of the figures in the first place would be a much better idea: this is exactly what graphics handles are for!
Murat Kocaman
Murat Kocaman 2018년 11월 23일
Thank you I am trying this.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

태그

질문:

2018년 10월 4일

댓글:

2018년 11월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by