isobject
Determine if input is MATLAB object
Syntax
tf = isobject(A)
Description
tf = isobject(A)
returnstrue
ifA
is an object of a MATLAB®class. Otherwise, it returnsfalse
.
Instances of MATLAB fundamental classes returnfalse
. Useisa
to test for any of these types. SeeFundamental MATLAB Classesfor more on these classes.
Examples
Define the following MATLAB class:
classdefbutton < handlepropertiesUiHandleendmethodsfunctionobj = button(pos) obj.UiHandle = uicontrol('Position',pos,...'Style','pushbutton');endendend
Test for MATLAB objects.
h = button([20 20 60 60]); isobject(h)
ans = logical 1
isobject(h.UiHandle)
ans = logical 1
Create an object that is a MATLAB numeric type:
a = pi; isobject(a)
logical 0
isa(a,'double')
ans = logical 1
Extended Capabilities
Introduced before R2006a
Was this topic helpful?