Main Content

mxGetNumberOfDimensions (C)

Number of dimensions in mxArray

C Syntax

#include "matrix.h"
mwSize mxGetNumberOfDimensions(const mxArray *pm);


mxGetNumberOfDimensions returns the number of dimensions in the specified mxArray. The returned value is always 2 or greater.

To determine how many elements are in each dimension, call mxGetDimensions.

Input Arguments

expand all

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


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

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

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

Introduced before R2006a