Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

mxGetNumberOfElements (C and Fortran) - Number of elements in mxArray

C Syntax

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

Fortran Syntax

mwPointer 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 matlabroot/extern/examples/refbook folder .

Additional examples:

See Also

mxGetDimensions, mxGetM, mxGetN, mxGetClassID, mxGetClassName

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

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