I have a 800x1 struct S with fields A, B, C, D, E, F and G. I want to add an eighth field H where H is a matrix 800x8191 double. There is a 1x8191 row of H for every element of S.
That is, I want to make the assignment S(i)=H(i,:) for every i.
I tried S.H=H or S.Hcalculated=H, but received the error "Scalar structure required for this assignment."
How can I succeed?
You may try
For example,
Note: if you need to perform row-wise operations on H, you should consider doing that first before appending its rows onto S for efficiency reasons.