I've been confused about MATLAB graphics since change to the new graphics system. I do not know how I can check for a variable being a handle to a figure or axes. Functions that come to mind are:
ishandleisgraphicsishghandleisa(x,'matlab.ui.Figure') % x being the variable representing a Figure or Axes
isa(x,'matlab.graphics.axis.Axes') % wow, these really are cumbersome commands!
% etc.
What are best practices to ensure maximal compatibility with most MATLAB versions to detect what kind of input I'm dealing with? Why are there no
isfigure
or
isaxes
functions built-in?
Best Answer