MATLAB: Close classregtree window programmatically

classregtreeStatistics and Machine Learning Toolboxview(t)

If I use the Statistics Toolbox tool classregtree like this:
load fisheriris; t = classregtree(meas,species,… 'names',{'SL' 'SW' 'PL' 'PW'}) view(t)
….the classification tree window pops up as expected.
How can I close this window from the command line? I cannot find the handle of this object to close it.
Any help appreciated.

Best Answer

I believe it creates a figure whose handle visibility is off. I do not know the name of the figure. Try
hiddenfigs = findall(0,'Type','figure', '-not', 'HandleVisibility', 'on');