| MATLAB Application Program Interface | Search  Help Desk |
| mxGetNumberOfElements | Examples See Also |
Get number of elements in an array
C Syntax
#include "matrix.h" int mxGetNumberOfElements(const mxArray *array_ptr);
Arguments
array_ptrmxArray.
Returns
Number of elements in the specifiedmxArray.
Description
mxGetNumberOfElements tells you how many "pieces" an array has. Use mxGetClassID to find out what the pieces are. These two functions provide the highest-level information about an array.
Examples
Seefindnz.c and phonebook.c in the refbook subdirectory of the examples directory.
For additional examples, see explore.c in the mex subdirectory of the examples directory; see mxcalcsinglesubscript.c, mxgeteps.c, mxgetinf.c, mxisfinite.c, and mxsetdimensions.c in the mx subdirectory of the examples directory.
See Also
mxGetDimensions, mxGetM, mxGetN, mxGetClassID, mxGetClassName