Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

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

1 Ansicht (letzte 30 Tage)
Darrian Low
Darrian Low am 25 Apr. 2018
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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:

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by