Mean of matrix by columns
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Alessandro Masullo
le 13 Oct 2013
Commenté : Alessandro Masullo
le 13 Oct 2013
Hello! I'm looking for a function to get the mean of two (or more) columns:
A = 1 2 3
4 5 6
7 8 9
f(A) =
1.5000 2.5000
4.5000 5.5000
7.5000 8.5000
How can I do that in a simple way, for a generic matrix? Thank you.
0 commentaires
Réponse acceptée
Plus de réponses (2)
sixwwwwww
le 13 Oct 2013
Modifié(e) : sixwwwwww
le 13 Oct 2013
Dear Alessandro, you can use MATLAB function "mean" for this purpose. Here is description: http://www.mathworks.com/help/matlab/ref/mean.html. In Your case just use
mean(A)
6 commentaires
sixwwwwww
le 13 Oct 2013
I think in anyway you will need to use at least one for loop. However if I will have better idea then I will come back to it
Voir également
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!