Info

此问题已关闭。 请重新打开它进行编辑或回答。

How to make a matrix that 'matches' with another matrix.

1 次查看(过去 30 天)
Hi,
I am trying to compute a matrix which 'matches' certain values in another matrix.
Here is where we start. The numbers in columns 1 and 2 which are also in the same row, need to be added together. For the first row, the number 1 needs to pull out the value 10 from MatrixB and add it with the number 2 which is 20. Thus giving us 30.
MatrixA
These are the values that need to be extracted. MatrixB
Now this is the plot twist and where I am stuck. The value 30 needs to be divided by 5 because there were values 1 and 2 in Matrix A. In MatrixC, the value next to 1 and 2 is 5.
Here is another example to ensure I get my question across. Numbers 2 and 3 (row 3, columns 1 and 2) will extract the values 20 and 30 which will make 50, this 50 needs to be divided by 7, which will give us 7.1428.
MatrixC
The final output, should look like this. A 4x1 matrix.
Here is my attempt at coding it:

回答(0 个)

此问题已关闭。

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by