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

Arguments

pm

Pointer to an mxArray

Returns

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

Description

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

Examples

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