필터 지우기
필터 지우기

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