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!!!
  1 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 5 月 23 日
Check here for the answer.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by