How do we create weighted average for a matrix?

조회 수: 1 (최근 30일)
stelios loizidis
stelios loizidis 2019년 5월 23일
댓글: KALYAN ACHARJYA 2019년 5월 23일
Hello,
I have a matrix e.g
[ 5 3 3 1
3 4 5 2
5 0 0 0
3 4 5 2]
For this matrix I have to make a weighted average for each row. That is, [5+3+(4/5)*(3+1)] / 4=16/5. Also if there is only one number and the rest zero (row 3), the weighted average should be (5+0+0+0) / 1=5 and in the end we choose the largest weighted average.
I would appreciate it very much if someone helped me!!!

답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by