This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

mxGetNumberOfDimensions (C and Fortran)

Number of dimensions in array

C Syntax

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

Fortran Syntax

#include "fintrf.h"
mwSize mxGetNumberOfDimensions(pm)
mwPointer pm



Pointer to an mxArray


Number of dimensions in the specified mxArray. The returned value is always 2 or greater.


Use mxGetNumberOfDimensions to determine how many dimensions are in the specified array. To determine how many elements are in each dimension, call mxGetDimensions.


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

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

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

Introduced before R2006a

Was this topic helpful?