I have an array of "object" structures, OBJECT_ARRAY
, that I must often transform into individual arrays for each element of the object structures. This can be done using arrayfun
. It's more tedious than simply refereeing to OBJECT_ARRAY(k).item1
, but that's how The Mathworks chose to do it.
In this case today, I have used those individual arrays and calculated a corresponding derived value, newItem
, for each element and I need to add this to the original array of structures. So I have an array of newItems
.
Is there a straightforward way to do an assignment for each object in OBJECT_ARRAY
so that (effectively) OBJECT_ARRAY(k).newItem = newItems(k)
for every index k
?
I am using version 2015a.