I am trying to import joint angle data from a struct array containing 2826 trials of motion capture data (Xsens) using a for loop, and output the data into an array with 2826 rows each containing a specific joint angle vector. The vectors are varying sizes, as there are not the same number of frames in each trial.
If I only import one trial at a time it works fine:
for a = 1:length(Trials)
nSamples(a) = length(Trials(a).tree.subject.frames.frame);
for b = 4:nSamples(1)
LeftKnee_FlexExt(b) = Trials(1).tree.subject.frames.frame(b).jointAngle(60);
RightKnee_FlexExt(b) = Trials(1).tree.subject.frames.frame(b).jointAngle(48);
I have tried to create a loop that imports all the 2826 trials to an array with rows of varying sizes, but I am stuck.
Thanks in advance for any assistance!