Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

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

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 matlabroot/extern/examples/refbook folder .

Additional examples:

Fortran Examples

See matdemo2.F in the matlabroot/extern/examples/eng_mat folder for sample programs that illustrate how to use the MAT-file routines in a Fortran program.

See Also

mxGetN, mxSetM, mxSetN

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

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