MATLAB: Check if figure exists whithout making it appear and using its figure number in findobj()

figure

Hi,
I want to know if a figure exists, however without it ever appearing at the forefront (I thus cannot use simply the figure() function). The function findobj() is a good candidate to solve this problem, however I do not want to use the 'name' as the argument for the search, i.e. I do not want to do:
findobj('type','figure','name','mytitle')
but rather use the number of the figure used when the figure is created, using
figure(nbrfig)
Does something like the following code exists?
findobj('type','figure','NUMBER OF THE FIGURE',nbrfig)
I tried number, handle, … instead of 'NUMBER OF THE FIGURE' but nothing works. Need help 🙂 thanks.

Best Answer

Since the figure number handles are the integer number, all you really need to do then is use
ishandle(n)
for the desired number.
Or, I'm not seeing the problem...???