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.

mxGetDimensions (C and Fortran)

Pointer to dimensions array

C Syntax

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

Fortran Syntax

#include "fintrf.h"
mwPointer mxGetDimensions(pm)
mwPointer pm



Pointer to an mxArray.


Pointer to the first element in the dimensions array. Each integer in the dimensions array represents the number of elements in a particular dimension. The array is not NULL terminated.


Use mxGetDimensions to determine how many elements are in each dimension of the mxArray that pm points to. Call mxGetNumberOfDimensions to get the number of dimensions in the mxArray.

To copy the values to Fortran, use mxCopyPtrToInteger4 in the following manner:

C      Get dimensions of mxArray, pm
       mxCopyPtrToInteger4(mxGetDimensions(pm), dims,  
     +                      mxGetNumberOfDimensions(pm))


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

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

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

Introduced before R2006a

Was this topic helpful?