| External Interfaces/API Reference | ![]() |
Get the number of fields in a structure mxArray
Fortran Syntax
Arguments
pm
Pointer to a structure mxArray.
Returns
The number of fields, on success. Returns 0 on failure of if no fields exist. The most common cause of failure is that pm is not a structure mxArray. Call mxIsStruct to determine if pm is a structure.
Description
Call mxGetNumberOfFields to determine how many fields are in the specified structure mxArray.
Once you know the number of fields in a structure, it is easy to loop through every field to set or to get field values.
See Also
mxGetField, mxIsStruct, mxSetField
| mxGetNumberOfElements | mxGetNzmax | ![]() |