Using the C Math Library | ![]() ![]() |
Assigning Values to Elements in a Field
By using mlfIndexAssign()
you can also modify array data contained in a structure field. You must specify the field name and the type of indexing to perform on the contained array. For example, the following call to mlfIndexAssign()
replaces a 3-by-3 subarray of the image data of the ninth image, with the data in the 3-by-3 array x
. (You might do this as part of some image processing operation.)
mlfIndexAssign(&images, "(?).image(?,?)", mlfScalar(9), mlfColon(mlfScalar(1), mlfScalar(3), NULL), mlfColon(mlfScalar(2), mlfScalar(4), NULL), x);
images(9).image(1:3,2:4) = x
performs the same operation in MATLAB.
![]() | Assigning Values to a Structure Field | Referencing a Single Structure in a Structure Array | ![]() |