I currently have a struct of arrays:
t2 =
cotrain_idx: [7x1 double]
trvate_idx: [7x1 double]
conf_param: 0
is_target: 0
orig_idx: 0
I also have an struct array with fields:
t3 =
1x7 struct array with fields:
type
latency
urevent
ImageName
isTarget
isAccurate
origEventIdx
I would like to copy all the elements comprising t3.isTarget to t2.is_target. However all my attempts result in errors:
t2.is_target(:)=t3(:).isTarget;
seems to onlt copy the first element, even though t3(:).isTarget clearly returns all 7 elements:
>>> t3(:).isTarget
ans =
0
ans =
1
ans =
1
ans =
1
ans =
1
ans =
1
ans =
1
Is there something obvious that I'm missing here? If I have to, I can copy the elements in one at a time, but I expect Matlab has a more efficient way to do this.