External Interfaces Reference Previous page   Next Page
mxGetField

Get structure array field value, given field name and index

Fortran Syntax

Arguments

pm
   Pointer to a structure mxArray.

index
   The desired element. The first element of an mxArray has an index of 1, the second element has an index of 2, and the last element has an index of N, where N is the total number of elements in the structure mxArray.

fieldname
   The name of the field whose value you want to extract.

Returns

A pointer to the mxArray in the specified field at the specified fieldname, on success. Returns zero if passed an invalid argument or if there is no value assigned to the specified field. Common causes of failure include:

Description

Call mxGetField to get the value held in the specified element of the specified field.

mxGetFieldByNumber is similar to mxGetField. Both functions return the same value. The only difference is in the way you specify the field. mxGetFieldByNumber takes fieldnumber as its third argument, and mxGetField takes fieldname as its third argument.

Calling

is equivalent to calling

where index is 1 if you have a one-by-one structure.

See Also

mxGetFieldByNumber, mxGetFieldNameByNumber, mxGetNumberOfFields, mxIsStruct, mxSetField, mxSetFieldByNumber


Previous page  mxGetEps mxGetFieldByNumber Next page

© 1994-2005 The MathWorks, Inc.