The following code fragment demonstrates how to extract a substructure and then extract a field from that substructure:
substructure_field_num = mxGetFieldNumber(pa, "substructure");
mxArray *sub = mxGetFieldByNumber(pa, index, substructure_field_num);
field_num = mxGetFieldNumber(sub, "my_field");
mxArray *myField = mxGetFieldByNumber(sub, index, field_num);
For more information on using structures in general, see the documentation for mxGetFieldByNumber and the related PHONEBOOK.C example. You can use the following command in MATLAB to access the documentation:
Best Answer