As mentioned in a related answer, it is possible to get the handles of all open figures using:
hFigs = findall(groot, 'Type', 'figure');
but this results in a list that contains both "old" figure
and "new" uifigure
handles.
How can I separate hFigs
into two lists, one containing only figure
and the other only uifigure
references?
To distinguish between
figure
anduifigure
objects programatically, we can use a slight adaptation of what I suggested here:It's advised to have a couple of warnings turned off before calling the above, e.g.
and to conclude:
This solution was tested on R2017a and R2017b.