Main Content

mxGetClassID (C)

Class of mxArray

C Syntax

#include "matrix.h"
mxClassID mxGetClassID(const mxArray *pm);

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 pm points to a logical mxArray, then mxGetClassID returns mxLOGICAL_CLASS (in C).

mxGetClassID is like mxGetClassName, except that the former returns the class as an integer identifier and the latter returns the class as a string.

Input Arguments

expand all

Pointer to an mxArray array, specified as const mxArray*.

Output Arguments

expand all

Numeric identifier of the class (category) of the mxArray, specified as mxClassID. For a list of C-language class identifiers, see the mxClassID function. If mxArray is an object array, then the returned value is not a member of the enumerated set of class identifiers. For user-defined types, mxGetClassID returns a unique value identifying the class of the array contents. Use mxIsClass to determine whether an array is of a specific user-defined type.

Examples

See these examples in matlabroot/extern/examples/mex:

See these examples in matlabroot/extern/examples/refbook:

Version History

Introduced before R2006a