This is machine translation

Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Translate This Page

MathWorks Machine Translation

The automated translation of this page is provided by a general purpose third party translator tool.

MathWorks does not warrant, and disclaims all liability for, the accuracy, suitability, or fitness for purpose of the translation.

isa

Determine if input is object of specified class

Syntax

tf = isa(obj,ClassName)tf = isa(obj,classCategory)

Description

tf = isa(obj,ClassName) returns true if obj is
an instance of the class specified by ClassName,
and false otherwise. isa also
returns true if obj is an instance of a class that
is derived from ClassName.

obj can be any MATLAB® variable.

ClassName can be any of the following:

Name of any MATLAB class or fundamental type

Name of a Java®, or .NET class

The table shows the names of many commonly used MATLAB data
types.

'single'

Single-precision number

'double'

Double-precision number

'int8'

Signed 8-bit integer

'int16'

Signed 16-bit integer

'int32'

Signed 32-bit integer

'int64'

Signed 64-bit integer

'uint8'

Unsigned 8-bit integer

'uint16'

Unsigned 16-bit integer

'uint32'

Unsigned 32-bit integer

'uint64'

Unsigned 64-bit integer

'logical'

Logical 1 (true) or 0 (false)

'char'

Character

'string'

String array

'struct'

Structure array

'cell'

Cell array

'table'

Table

'function_handle'

Function handle

tf = isa(obj,classCategory) returns true if obj is
an instance of any of the classes in the specified classCategory,
and false otherwise. isa also
returns true if obj is an instance of a class that
is derived from any of the classes in classCategory.

classCategory can be 'numeric', 'float',
or 'integer', representing a category of numeric
types:

if strcmp(colorcodes('Color'),'Yellow') && ...
isa(colorcodes('RGB'),'uint8')
disp '''The Color is Yellow and the RGB numbers are uint8 values'''end'The Color is Yellow and the RGB numbers are uint8 values'