MATLAB Answers

Is there a way to close all opened MATLAB/Simulink figures at once?

1,560 views (last 30 days)
I would like to close all opened MATLAB/Simulink figures at once.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 24 Apr 2018
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));
To close all open Simulink models, use the command
bdclose all
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

Sign in to comment.

More Answers (1)

Chase
Chase on 3 Jul 2014
Edited: MathWorks Support Team on 6 Apr 2018

Categories

Tags

No tags entered yet.

Products

Community Treasure Hunt

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

Start Hunting!