I need to fill a large matrix with data coming from a smaller matrix. Both matrices contains a first column with an index and a second column with the results of an experiment. I need to combine the results according to their index. For example I have a matrix A:
1 12 13 14 15 16 17 18 19 1
And a matrix B
1 102 104 107 10
I would like to combine them to obtain the matrix C with 3 columns (column 1 for index, column 2 results from A, column 3 results from B)
1 1 102 1 103 1 NaN4 1 105 1 NaN6 1 NaN7 1 108 1 NaN9 1 NaN
I have to do that on matrices with millions of rows, therefore methods limiting calculation time would be welcome. Thank you very much for any help.
Best Answer