| MATLAB Application Program Interface Reference | Help Desk |
mxGetNumberOfElements
Get number of elements in an array
#include "matrix.h" int mxGetNumberOfElements(const mxArray *array_ptr);array_ptr Number of elements in the specified
mxArray.
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.
See mxGetNumberOfElements.c in the mx subdirectory of the examples directory.
mxGetDimensions, mxGetM, mxGetN, mxGetClassID, mxGetClassName