MATLAB Function Reference | ![]() ![]() |
Detect an object of a given MATLAB class or Java class
Syntax
K = isa(obj,'class_name
')
Description
K = isa(obj,'
returns logical true (class_name
')
1
) if obj
is of class (or a subclass of) class_name
, and logical false (0
) otherwise.
The argument obj
is a MATLAB object or a Java object. The argument class_name
is the name of a MATLAB (predefined or user-defined) or a Java class. Predefined MATLAB classes include:
You cannot use isa
to identify a logical value. Use islogical
for this instead.
Examples
isa(rand(3,4),'double') ans = 1
The following example creates an instance of the user-defined MATLAB
class, named polynom
. The isa
function identifies the object as being of the polynom
class.
polynom_obj = polynom([1 0 -2 -5]); isa(polynom_obj,'polynom') ans = 1
See Also
![]() | is* | isappdata | ![]() |