External Interfaces Reference Previous page   Next Page
mxGetFieldNameByNumber

Get structure array field name, given field number

Fortran Syntax

Arguments

pm
   Pointer to a structure mxArray.

fieldnumber
   The position of the desired field. For instance, to get the name of the first field, set fieldnumber to 1; to get the name of the second field, set fieldnumber to 2; and so on.

Returns

The nth field name, on success. Returns 0 on failure. Common causes of failure include:

Description

Call mxGetFieldNameByNumber to get the name of a field in the given structure mxArray. A typical use of mxGetFieldNameByNumber is to call it inside a loop to get the names of all the fields in a given mxArray.

Consider a MATLAB structure initialized to

The field number 1 represents the field name; field number 2 represents field billing; field number 3 represents field test. A field number other than 1, 2, or 3 causes mxGetFieldNameByNumber to return 0.

See Also

mxGetField, mxIsStruct, mxSetField


Previous page  mxGetFieldByNumber mxGetFieldNumber Next page

© 1994-2005 The MathWorks, Inc.