To close all open figures, use the command
Figures with the 'HandleVisibility' property set to 'off' will not be closed with "close all". To close these figures, use the command
To close all open Simulink models, use the command
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(findall(groot, 'Type', 'figure', 'FileName', []));
Best Answer