フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

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

1 回表示 (過去 30 日間)
Darrian Low
Darrian Low 2018 年 4 月 25 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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