dt1 dt2 dt3 dt
1 3 6 10
2 4 1 5
3 6 5 3
4 7 4 1
5 1 2 4
6 2 8
7 8
8
9
10
I have the above data which I want to combine in one single matrix (10 x 4). The maximum number of rows is 10. I created a zeros
matrix. However, I have a problem since the data doesn't have the same dimensions. How it is possible to get the output as below? Should I sort the data and replace the missing values with 0?
1 1 1 1
2 2 2 0
3 3 0 3
4 4 4 4
5 0 5 5
6 6 6 0
7 7 0 0
8 8 8 0
9 0 0 0
10 0 0 10