Number of elements in numeric array
#include "matrix.h" size_t mxGetNumberOfElements(const mxArray *pm);
#include "fintrf.h" mwPointer mxGetNumberOfElements(pm) mwPointer pm
pm
Pointer to a numeric mxArray
Number of elements in the specified mxArray
mxGetNumberOfElements
tells you how many elements an array has.
For example, if the dimensions of an array are 3-by-5-by-10, then
mxGetNumberOfElements
returns the number
150
.
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 these examples in
:matlabroot
/extern/examples/refbook
See these examples in
:matlabroot
/extern/examples/mx
See these examples in
:matlabroot
/extern/examples/mex
mxGetDimensions
, mxGetM
,
mxGetN
,
mxGetClassID
,
mxGetClassName