Check validity of handle
iptcheckhandle(
checks if object obj
,valid_types
,func_name
,var_name
,arg_pos
)obj
is a valid graphics object and issues a
formatted error message if the handle is invalid.
If the object is a valid graphics object as specified by
valid_types
, then iptcheckhandle
returns nothing.
If the connectivity argument is invalid, then
iptcheckhandle
issues a formatted error message that
includes information about the function name
(func_name
), the variable name
(var_name
), and the argument position
(arg_pos
). These values are used only to create the
error message, not to check whether the graphics object handle is
valid.
The figure shows the format of the error message and indicates which parts you can
customize using iptcheckhandle
arguments.
To trigger the error message, create a figure that does not contain an axes object and then check for a valid axes handle.
fig = figure; % create figure without an axes iptcheckhandle(fig,{'axes'},'my_function','my_variable',2)
fig
is not an axes handle so iptcheckhandle
returns an error message:
Function MY_FUNCTION expected its second input argument, my_variable, to be one of these types: axes Instead, its type was: figure.
iptcheckmap
| iptnum2ordinal
| narginchk
| validateattributes
| validatestring