mxClassID (C)

Enumerated value identifying class of array

C Syntax

typedef enum {
        mxUNKNOWN_CLASS,
        mxCELL_CLASS,
        mxSTRUCT_CLASS,
        mxLOGICAL_CLASS,
        mxCHAR_CLASS,
        mxVOID_CLASS,
        mxDOUBLE_CLASS,
        mxSINGLE_CLASS,
        mxINT8_CLASS,
        mxUINT8_CLASS,
        mxINT16_CLASS,
        mxUINT16_CLASS,
        mxINT32_CLASS,
        mxUINT32_CLASS,
        mxINT64_CLASS,
        mxUINT64_CLASS,
        mxFUNCTION_CLASS
} mxClassID;

Constants

mxUNKNOWN_CLASS

Undetermined class. You cannot specify this category for an mxArray; however, if mxGetClassID cannot identify the class, it returns this value.

mxCELL_CLASS

Identifies a cell mxArray.

mxSTRUCT_CLASS

Identifies a structure mxArray.

mxLOGICAL_CLASS

Identifies a logical mxArray, an mxArray of mxLogical data.

mxCHAR_CLASS

Identifies a string mxArray, an mxArray whose data is represented as mxChar.

mxVOID_CLASS

Reserved.

mxDOUBLE_CLASS

Identifies a numeric mxArray whose data is stored as the type specified in the MATLAB® Primitive Types table.

mxSINGLE_CLASS

Identifies a numeric mxArray whose data is stored as the type specified in the MATLAB Primitive Types table.

mxINT8_CLASS

Identifies a numeric mxArray whose data is stored as the type specified in the MATLAB Primitive Types table.

mxUINT8_CLASS

Identifies a numeric mxArray whose data is stored as the type specified in the MATLAB Primitive Types table.

mxINT16_CLASS

Identifies a numeric mxArray whose data is stored as the type specified in the MATLAB Primitive Types table.

mxUINT16_CLASS

Identifies a numeric mxArray whose data is stored as the type specified in the MATLAB Primitive Types table.

mxINT32_CLASS

Identifies a numeric mxArray whose data is stored as the type specified in the MATLAB Primitive Types table.

mxUINT32_CLASS

Identifies a numeric mxArray whose data is stored as the type specified in the MATLAB Primitive Types table.

mxINT64_CLASS

Identifies a numeric mxArray whose data is stored as the type specified in the MATLAB Primitive Types table.

mxUINT64_CLASS

Identifies a numeric mxArray whose data is stored as the type specified in the MATLAB Primitive Types table.

mxFUNCTION_CLASS

Identifies a function handle mxArray.

Description

Various MX Matrix Library functions require or return an mxClassID argument. mxClassID identifies the way in which the mxArray represents its data elements.

The following table shows MATLAB types with their equivalent C types. Use the type from the right-most column for reading mxArrays with the mxClassID value shown in the left column.

MATLAB Primitive Types

mxClassID ValueMATLAB TypeMEX TypeC Primitive Type
mxINT8_CLASS

int8

int8_T

char, byte

mxUINT8_CLASS

uint8

uint8_T

unsigned char, byte

mxINT16_CLASS

int16

int16_T

short

mxUINT16_CLASS

uint16

uint16_T

unsigned short

mxINT32_CLASS

int32

int32_T

int

mxUINT32_CLASS

uint32

uint32_T

unsigned int

mxINT64_CLASS

int64

int64_T

long long

mxUINT64_CLASS

uint64

uint64_T

unsigned long long

mxSINGLE_CLASS

single

float

float

mxDOUBLE_CLASS

double

double

double

Examples

See the following examples in matlabroot/extern/examples/mex.

Was this topic helpful?