MATLAB Function Reference    
isa

Detect an object of a given MATLAB class or Java class

Syntax

Description

K = isa(obj,'class_name') returns logical true (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:

cell
Cell array
char
Characters array
double
Double-precision floating-point array
function_handle
Function Handle
int8
8-bit signed integer array
int16
16-bit signed integer array
int32
32-bit signed integer array
numeric
Integer or floating-point array
single
Single-precision floating-point array
sparse
2-D real (or complex) sparse array
struct
Structure array
uint8
8-bit unsigned integer array
uint16
16-bit unsigned integer array
uint32
32-bit unsigned integer array

You cannot use isa to identify a logical value. Use islogical for this instead.

Examples

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.

See Also

class,is


 is* isappdata