mxGetClassName (C and Fortran)

Class of array as string

Use mxGetClassName for classes defined without a classdef statement.

C Syntax

#include "matrix.h"
const char *mxGetClassName(const mxArray *pm);

Fortran Syntax

#include "fintrf.h"
character*(*) mxGetClassName(pm)
mwPointer pm



Pointer to an mxArray


Class (as a string) of the mxArray pointed to by pm.


Call mxGetClassName 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, mxGetClassName returns logical.

mxGetClassID is similar to the mxGetClassName function.

  • mxGetClassID returns the class as an integer identifier, as described in mxClassID.

  • mxGetClassName returns the class as a string, as described in mxIsClass.


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

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

Introduced before R2006a