Close all drawings when a script is running in Matlab

Suppose Matlab runs a script. Is there a way to close all numbers? (Closing each shape individually is tedious, and since the script is working, I cannot add close all to it.)

+8
matlab
source share
2 answers

This works for me (tested in R2010b): at the Matlab command prompt, go to the menu bar, select Windows , then Close All Documents . This closes all the pictures, as well as the editor files, while the m file is working.

enter image description here

+2
source share

I recommend running such scripts using the command line version of matlab, including the -noFigureWindows option. If you want to run it in the full matlab user interface (which is slower), use a timer object:

 t = timer('TimerFcn',@(x,y)(close('all')), 'Period', 10.0); start(t) 

Remember to close and delete the timer after the script completes.

+2
source share

All Articles