I have two matrices. The first matrix "A" has 2 columns and 425 rows of data. Matrix "B" has 10 columns and 468 rows of data.
I need to assign rows 5 through 9 of Matrix B into rows 3 through 7 of Matrix A based on matching values in column 2 of B and column 10 in A (2 and 10 are indexes). For example:
Matrix A:711875 1711883 32711884 22712548 43Matrix B:1950 11 22 5 -1.5 46 -1.9 21 1 11951 3 11 5 -2.0 42 -1.6 33 1 21958 2 12 8 -2.0 34 -2.6 16 1 31960 2 29 17 -1.9 41 -2.2 25 1 41962 1 7 6 -1.6 34 -1.7 18 1 51962 12 8 6 -2.1 34 -2.1 16 1 61963 12 14 8 -1.6 37 -1.8 17 2 71965 3 3 6 -1.6 43 -1.5 31 2 81966 1 24 8 -1.6 35 -2.1 16 3 91967 2 21 5 -1.5 41 -2.1 22 3 10
The output should then be:
[711875, 1, 1950, 11, 22, 5, -1.5, 46, -1.9, 21, 1, 1]
where the " , " denotes columns. Therefore the first two columns would be from Matrix A while the last 10 columns would be from Matrix B. So 12 columns in total.
Best Answer