matlab mxsetn函数语法

发表matlab mxsetn函数相关文章
一句话说明: Set number of columns in array

mxSetN (C and Fortran)

Set number of columns in array

C Syntax

#include "matrix.h"
void mxSetN(mxArray *pm, mwSize n);

Fortran Syntax

subroutine mxSetN(pm, n)
mwPointer pm
mwSize n

Arguments

pm

Pointer to an mxArray

n

Number of columns

Description

Call mxSetN to set the number of columns in the specified mxArray. The term columns always means the second dimension of a matrix. Calling mxSetN forces an mxArray to have two dimensions. For example, if pm points to an mxArray having three dimensions, calling mxSetN reduces the mxArray to two dimensions.

You typically use mxSetN to change the shape of an existing mxArray. The mxSetN function does not allocate or deallocate any space for the pr, pi, ir, or jc arrays. Consequently, if your calls to mxSetN and mxSetM increase the number of elements in the mxArray, enlarge the pr, pi, ir, and/or jc arrays.

If your calls to mxSetM and mxSetN end up reducing the number of elements in the mxArray, you might want to reduce the sizes of the pr, pi, ir, and/or jc arrays in order to use heap space more efficiently. However, reducing the size is not mandatory.

Examples

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

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

See Also

mxGetM, mxGetN, mxSetM

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

与matlab mxsetn用法相关的文章

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