8 Dec 2022

Find All Opened Matlab Figures

收藏到CSDN网摘

Sometimes, Matlab is really good at plotting data for analysis or image processing. The simple figure() function can be used to create a new figure to plot on. Otherwise, it will plot directly on the last existing (or the current figure, which can be accessed via gcf function) figure. Moreover, the existing plotted data would be overwritten if you forgot to turn 'hold on' to preserve the current plots. So it's very common to always call figure() to get a new convas before plotting. However, this leads to another problem that you may get massive number of figures opened after a while using Matlab. I call it as Figure Explosion. To get rid of all open figures, one can simply type 'close all'. However, what if there are some figures you'd like to keep but you just cannot find them manually. How can we close some figures selectively based on there properties, e.g. names maybe? Here it is!