External Interfaces/API Reference    
mxGetNumberOfElements

Get number of elements in an array

C Syntax

Arguments

array_ptr
   Pointer to an mxArray.

Returns

Number of elements in the specified mxArray.

Description

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 will return the number 150.

Examples

See findnz.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


  mxGetNumberOfDimensions mxGetNumberOfFields