matlab mxcreatestructmatrix函数语法

发表matlab mxcreatestructmatrix函数相关文章
一句话说明: 2-D structure array

mxCreateStructMatrix (C and Fortran)

2-D structure array

C Syntax

#include "matrix.h"
mxArray *mxCreateStructMatrix(mwSize m, mwSize n, int nfields, 
         const char **fieldnames);

Fortran Syntax

mwPointer mxCreateStructMatrix(m, n, nfields, fieldnames)
mwSize m, n
integer*4 nfields
character*(*) fieldnames(nfields)

Arguments

m

Number of rows. This must be a positive integer.

n

Number of columns. This must be a positive integer.

nfields

Number of fields in each element.

fieldnames

List of field names.

Each structure field name must begin with a letter and is case sensitive. The rest of the name may contain letters, numerals, and underscore characters. Use the namelengthmax function to determine the maximum length of a field name.

Returns

Pointer to the created mxArray, if successful. If unsuccessful in a standalone (non-MEX-file) application, returns NULL in C (0 in Fortran). If unsuccessful in a MEX-file, the MEX-file terminates and returns control to the MATLAB® prompt. The function is unsuccessful when there is not enough free heap space to create the mxArray.

Description

mxCreateStructMatrix and mxCreateStructArray are almost identical. The only difference is that mxCreateStructMatrix can create only two-dimensional mxArrays, while mxCreateStructArray can create mxArrays having two or more dimensions.

C Examples

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

See Also

mxCreateStructArray

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

与matlab mxcreatestructmatrix用法相关的文章

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