MATLAB Application Program Interface
  Go to function:
    Search    Help Desk 
mxGetClassID    Examples   See Also

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. Classes are:

mxCELL_CLASS
  Identifies a cell mxArray.

mxSTRUCT_CLASS
  Identifies a structure mxArray.

mxOBJECT_CLASS
  Identifies a user-defined (nonstandard) mxArray.

mxCHAR_CLASS
  Identifies a string mxArray; that is an mxArray whose data is represented as mxCHAR's.

mxSPARSE_CLASS
  Identifies a sparse mxArray; that is, an mxArray that only stores its nonzero elements.

mxDOUBLE_CLASS
  Identifies a numeric mxArray whose data is stored as double-precision, floating-point numbers.

mxSINGLE_CLASS
  Identifies a numeric mxArray whose data is stored as single-precision, floating-point numbers.

Identifies a numeric mxArray whose data is stored as signed 8-bit integers.

Identifies a numeric mxArray whose data is stored as unsigned 8-bit integers.

Identifies a numeric mxArray whose data is stored as signed 16-bit integers.

Identifies a numeric mxArray whose data is stored as unsigned 16-bit integers.

Identifies a numeric mxArray whose data is stored as signed 32-bit integers.

Identifies a numeric mxArray whose data is stored as unsigned 32-bit integers.

Reserved for possible future use.

Reserved for possible future use.

The class cannot be determined. You cannot specify this category for an mxArray; however, mxGetClassID can return this value if it cannot identify the class.

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.

See Also

mxGetClassName



[ Previous | Help Desk | Next ]