Using the C Math Library | ![]() ![]() |
Referencing into Nested Structures
Structures can contain other structures. The image structure used in these examples contains a date structure, for example. To retrieve data from nested structures, you only need a single call to mlfIndexRef()
. Simply specify the nested structure reference operation in the second argument, as shown here:
mlfAssign(&y, mlfIndexRef(images,"(?).date.year",mlfScalar(2)));
y = images(2).date.year
performs the same operation in MATLAB.
You can also assign to this location by using mlfIndexAssign()
instead of mlfIndexRef()
.
![]() | Referencing a Single Structure in a Structure Array | Accessing the Contents of Structures Within Cells | ![]() |