I have defined an array of structs as follows:
t3(1:num_elems) = struct('prime_idx',0,'second_idx',0,);
I would like to copy an array nic to the prime_idx field of t3, so that t3(x).prime_idx == nic(x) for all x. I've tried:
t3.prime_idx = nic;
and [t3.prime_idx] = nic; and t3.prime_idx = [nic]; and [t3.prime_idx] = [nic];
and various permutations of adding (:) after the two array variables t3 and nic.
How can I copy each element of nic to the corresponding prime_idx field of the corresponding element of t3?