How do we create weighted average for a matrix?

2 vues (au cours des 30 derniers jours)
stelios loizidis
stelios loizidis le 23 Mai 2019
Commenté : KALYAN ACHARJYA le 23 Mai 2019
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!!!

Réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by