Current figure handle
returns
the current figure handle.
If a figure does not exist, then fig
= gcfgcf
creates a
figure and returns its handle. You can use the figure handle to query
and modify figure properties. For more information, see Figure Properties.
To get the handle of the current figure without forcing
the creation of a figure if one does not exist, query the CurrentFigure
property
on the root object.
fig = get(groot,'CurrentFigure');
fig
as an
empty array if there is no current figure.