External Interfaces/API Reference |
Get a field value, given a field number and an index in a structure array
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
.
fieldnumber
The position of the field whose value you want to extract. The first field within each element has a field number of 1
, the second field has a field number of 2
, and so on. The last field has a field number of N
, where N
is the number of fields.
Returns
A pointer to the mxArray
in the specified field for the desired element, 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:
pm
that does not point to a structure mxArray
. Call mxIsStruct
to determine if pm
points to is a structure mxArray
.
1
or > the number of elements in the array.
mxGetFieldNumber
to determine the field number that corresponds to a given field name.
Description
Call mxGetFieldByNumber
to get the value held in the specified fieldnumber
at the indexed element.
where index
is 1
if you have a one-by-one structure.
See Also
mxGetField
, mxGetFieldNameByNumber
, mxGetNumberOfFields
, mxSetField
, mxSetFieldByNumber
mxGetField | mxGetFieldNameByNumber |