student1 student2 student3
code score code score code score
1 20 1 100 1 22
2 11 3 11 2 90
3 12 4 22 5 11
4 11
5 28
This question is related to http://stackoverflow.com/questions/3174631/matlab-how-to-combine-uneven-matric-into-single-matrix but a little bit different. I want to combine n files which have different size. Each file read through loop. How I can get the output as shown below?
for i=1:n
....
inputdata=[code score];
sortdata= sortrows(inputdata,1);
end
Output
code s1 s2 s3
1 20 100 22
2 11 0 90
3 12 11 0
4 11 22 0
5 28 0 11