matlab mxgetn函数语法

发表matlab mxgetn函数相关文章
一句话说明: Number of columns in array

mxGetN (C and Fortran)

Number of columns in array

C Syntax

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

Fortran Syntax

mwPointer mxGetN(pm)
mwPointer pm

Arguments

pm

Pointer to an mxArray

Returns

Number of columns in the mxArray.

Description

Call mxGetN to determine 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 and you need to know exactly how many elements are in each dimension, call mxGetDimensions.

If pm points to a sparse mxArray, mxGetN still returns the number of columns, not the number of occupied columns.

    Note:   Fortran does not have an equivalent of size_t. mwPointer is a preprocessor macro that provides the appropriate Fortran type. The value returned by this function, however, is not a pointer.

Examples

See the following examples in matlabroot/extern/examples/refbook.

See the following examples in matlabroot/extern/examples/mx.

See the following examples in matlabroot/extern/examples/mex.

See the following examples in matlabroot/extern/examples/eng_mat.

See Also

mxGetM, mxGetDimensions, mxSetM, mxSetN

欢迎转载,转载请注明来自一手册:http://yishouce.com/matlab/func/mxgetn

与matlab mxgetn用法相关的文章

友情链接It题库(ittiku.com)| 版权归yishouce.com所有| 友链等可联系 admin#yishouce.com|粤ICP备16001685号-1