How to kill all figure windows in MATLAB?

127 views (last 30 days)
Mr M.
Mr M. on 15 Apr 2015
Commented: Adam Danz on 2 Sep 2021
Is it possible to kill all figure windows with only a single click or command?

Answers (2)

Dishant Arora
Dishant Arora on 15 Apr 2015
close all
Pintu Saini
Pintu Saini on 2 Sep 2021
not working for me in online matlab.
Adam Danz
Adam Danz on 2 Sep 2021
@Pintu Saini I assum you're responding to Dishant's answer rather than my comment directly under the answer. I've also added a new answer that may be more visible.

Sign in to comment.

Adam Danz
Adam Danz on 2 Sep 2021
close all force
% or
In R2016a, Matlab introduced uifigure which has hidden handles by default so they go undetected by the "close all" request. Figure handle visiblilty can be changed from the HandleVisibility property.


Find more on Interactive Control and Callbacks in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!