mxGetN (C)
Number of columns in mxArray
C Syntax
#include "matrix.h" size_t mxGetN(const mxArray *pm);
Description
mxGetN returns the number of columns in the specified
mxArray.
If pm is an N-dimensional mxArray,
mxGetN is the product of dimensions 2 through N. For example,
if pm points to a four-dimensional mxArray having
dimensions
13-by-5-by-4-by-6,
mxGetN returns the value 120 (5 × 4
× 6). If the specified mxArray has more than two dimensions,
then call mxGetDimensions to find out how many elements are in each
dimension.
If pm points to a sparse mxArray,
mxGetN still returns the number of columns, not the number of
occupied columns.
Input Arguments
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
See Also
mxGetM | mxGetDimensions | mxSetM | mxSetN