MATLAB Application Program Interface Reference Help Desk

mxGetClassID

Purpose

Get (as an enumerated constant) an mxArray's class

C Syntax

Arguments

array_ptr

Pointer to an mxArray.

Returns

The class (category) of the mxArray that array_ptr points to.

Description

Use mxGetClassId to determine the class of an mxArray. The class of an mxArray identifies the kind of data the mxArray is holding. For example, if array_ptr points to a sparse mxArray, then mxGetClassID returns mxSPARSE_CLASS.

mxGetClassID is similar to mxGetClassName, except that the former returns the class as an enumerated value and the latter returns the class as a string.

Examples

Consider a MEX-file that can accept any kind of mxArray as its first input argument. If you intend to take action on the first input argument depending on its class, the first step is to call mxGetClassID.

For an additional example, see mxGetClassID.c in the mx subdirectory of the examples directory.

See Also

mxGetClassName



[ Previous | Help Desk | Next ]