Main Content

mxGetNumberOfElements (C)

Number of elements in numeric mxArray

C Syntax

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

Description

mxGetNumberOfElements returns the number of elements in the specified mxArray, returned as size_t. For example, if the dimensions of an array are 3-by-5-by-10, then mxGetNumberOfElements returns the number 150.

Input Arguments

expand all

Pointer to an mxArray array, specified as const mxArray*.

Examples

To open an example, type:

edit([fullfile(matlabroot,"extern","examples","refbook","filename")]);

where filename is:

To open an example, type:

edit([fullfile(matlabroot,"extern","examples","mx","filename")]);

where filename is:

To open an example, type:

edit([fullfile(matlabroot,"extern","examples","mex","filename")]);

where filename is:

Version History

Introduced before R2006a