Assume the following hypothetical Matlab data (as column vectors): for 3 subjects (i=1 to 3) each provides three measurements y1, y2 , y3, over 5 time points (j=1 to 5) or less (unbalanced). The original data set is bigger. so I need to use cell array. I need at the end have Y=cell(3,1), such that, for a subject i, Y{i} is a matrix represents the repeated measures for subject i.
i j y1 y2 y3
1 1 1.0 0.6 0.8
1 2 0.8 0.7 0.2
1 3 1.0 0.7 0.9
1 4 1.0 0.8 0.7
1 5 0.7 0.8 0.9
2 1 0.5 0.7 0.8
2 2 0.4 0.7 0.6
2 3 0.4 0.5 0.8
3 1 0.4 0.5 0.7
3 2 0.5 0.6 0.8
3 3 0.5 0.6 0.8
3 4 0.6 0.6 0.8
So I need them look like
Y{1}=
1.0 0.6 0.8
0.8 0.7 0.2
1.0 0.7 0.9
1.0 0.8 0.7
0.7 0.8 0.9
Y{2}=
0.5 0.7 0.8
0.4 0.7 0.6
0.4 0.5 0.8
Y{3}=
0.4 0.5 0.7
0.5 0.6 0.8
0.5 0.6 0.8
0.6 0.6 0.8
I need also to use i and j to help in indexing