mxGetNumberOfElements (C and Fortran) - Get number of elements in mxArray

C Syntax

#include "matrix.h"
mwSize mxGetNumberOfElements(const mxArray *pm);

Fortran Syntax

mwSize mxGetNumberOfElements(pm)
mwPointer pm

Arguments

pm

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, mxGetNumberOfElements returns the number 150.

C Examples

See findnz.c and phonebook.c in the refbook subdirectory of the examples directory.

Additional examples:

See Also

mxGetDimensions, mxGetM, mxGetN, mxGetClassID, mxGetClassName

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS