mxGetM (C and Fortran) - Get number of rows in mxArray

C Syntax

#include "matrix.h"
size_t mxGetM(const mxArray *pm);

Fortran Syntax

mwPointer mxGetM(pm)
mwPointer pm

Arguments

pm

Pointer to an mxArray

Returns

The number of rows in the mxArray to which pm points.

Description

mxGetM returns the number of rows in the specified array. The term rows always means the first dimension of the array, no matter how many dimensions the array has. For example, if pm points to a four-dimensional array having dimensions 8-by-9-by-5-by-3, mxGetM returns 8.

C Examples

See convec.c in the refbook subdirectory of the examples directory.

Additional examples:

Fortran Examples

See matdemo2.F in the eng_mat subdirectory of the examples directory for a sample program that illustrates how to use this routine in a Fortran program.

See Also

mxGetN, mxSetM, mxSetN

  


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