Is there a way to close all open MATLAB figures at once?
397 views (last 30 days)
Show older comments
MathWorks Support Team
on 27 Jun 2009
Edited: MathWorks Support Team
on 29 Aug 2024
I would like to close all opened MATLAB figures at once.
Accepted Answer
MathWorks Support Team
on 29 Aug 2024
Edited: MathWorks Support Team
on 29 Aug 2024
To close all open figures, use the command
close all
Figures with the 'HandleVisibility' property set to 'off' will not be closed with "close all". To close these figures, use the command
delete(findall(0));
If you have a GUI that opens plot windows and you would like to close all plots without closing the GUI at the same time, then you can use the following code:
% Delete all Figures with an empty FileName property
delete(findall(groot, 'Type', 'figure', 'FileName', []));
0 Comments
More Answers (1)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!