isa - Determine whether input is object of given class matlab

本文介绍了MATLAB中ISA函数的用法,该函数用于判断输入对象是否为指定类或其子类的对象。文中列举了多种预定义MATLAB类,并通过实例展示了如何使用ISA函数进行对象类型检查。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

isa - Determine whether input is object of given class

Syntax

K = isa(obj, 'class_name')

Description

K = isa(obj, 'class_name') returnslogical 1 (true) if obj isof class (or a subclass of) class_name,and logical 0 (false) otherwise.

The argument obj is a MATLAB objector an object of the Java programming language. The argument class_name isthe name of a MATLAB (predefined or user-defined) or a Java class.Predefined MATLAB classes include

logical

Logical array of true and false values

char

Characters array

numeric

Integer or floating-point array

integer

Signed or unsigned integer array

int8

8-bit signed integer array

uint8

8-bit unsigned integer array

int16

16-bit signed integer array

uint16

16-bit unsigned integer array

int32

32-bit signed integer array

uint32

32-bit unsigned integer array

int64

64-bit signed integer array

uint64

64-bit unsigned integer array

float

Single- or double-precision floating-point array

single

Single-precision floating-point array

double

Double-precision floating-point array

cell

Cell array

struct

Structure array

function_handle

Function handle

'class_name'

MATLAB class or Java class

To check for a sparse array, use issparse.To check for a complex array, use ~isreal.

Examples

isa(rand(3,4),'double')
ans =
    1

The following example creates an instance of the user-defined MATLAB classnamed polynom. The isa functionidentifies the object as being of the polynom class.

polynom_obj = polynom([1 0 -2 -5]);
isa(polynom_obj, 'polynom')
ans =
     1

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值