| 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" mwSize mxGetNumberOfDimensions(const mxArray *pm);
mwSize mxGetNumberOfDimensions(pm) mwPointer pm
Number of dimensions in the specified mxArray. The returned value is always 2 or greater.
Use mxGetNumberOfDimensions to determine how many dimensions are in the specified array. To determine how many elements are in each dimension, call mxGetDimensions.
See explore.c in the matlabroot/extern/examples/mex folder .
Additional examples:
findnz.c, fulltosparse.c, and phonebook.c in the matlabroot/extern/examples/refbook folder
mxcalcsinglesubscript.c, mxgeteps.c, and mxisfinite.c in the matlabroot/extern/examples/mx folder .
mxSetM, mxSetN, mxGetDimensions
![]() | mxGetNaN (C and Fortran) | mxGetNumberOfElements (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 |