How do we create weighted average for a matrix?

1 visualización (últimos 30 días)
stelios loizidis
stelios loizidis el 23 de Mayo de 2019
Comentada: KALYAN ACHARJYA el 23 de Mayo de 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!!!

Respuestas (0)

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by