| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
#include "matrix.h" size_t mxGetM(const mxArray *pm);
mwPointer mxGetM(pm) mwPointer pm
Number of rows in the mxArray to which pm points.
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.
Note Fortran does not have an equivalent of size_t. mwPointer is a preprocessor macro that provides the appropriate Fortran type. The value returned by this function, however, is not a pointer. |
See convec.c in the matlabroot/extern/examples/refbook folder .
Additional examples:
fulltosparse.c, revord.c, timestwo.c, and xtimesy.c in the matlabroot/extern/examples/refbook folder
explore.c, mexget.c, mexlock.c, mexsettrapflag.c and yprime.c in the matlabroot/extern/examples/mex folder
mxmalloc.c, mxsetdimensions.c, mxgetnzmax.c, and mxsetnzmax.c in the matlabroot/extern/examples/mx folder
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.
![]() | mxGetLogicals (C) | mxGetN (C and Fortran) | ![]() |

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 |