mxGetDimensions (C and Fortran) - Get pointer to dimensions array

C Syntax

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

Fortran Syntax

mwPointer mxGetDimensions(pm)
mwPointer pm

Arguments

pm

Pointer to an mxArray.

Returns

The address of 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.

Description

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))

C Examples

See mxcalcsinglesubscript.c in the mx subdirectory of the examples directory.

Additional examples:

See Also

mxGetNumberOfDimensions

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS