MATLAB Application Program Interface
  Go to function:
    Search    Help Desk 
mxGetDimensions    Examples   See Also

Get a pointer to the dimensions array

C Syntax

Arguments

array_ptr
  Pointer to an mxArray.

Returns

The address of the first element in a dimension 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 array_ptr points to. Call mxGetNumberOfDimensions to get the number of dimensions in the mxArray.

Example

Consider a MEX-file named GetSize that returns the size of each dimension of an input mxArray:

In MATLAB, create a variable named my4d, then pass my4d to GetSize:

Call GetSize to return the size of each dimension in my4d:

See Also

mxGetNumberOfDimensions



[ Previous | Help Desk | Next ]