Taking mean without max values
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Sammy
le 9 Oct 2015
Réponse apportée : Robert Dylans
le 9 Oct 2015
Hello, How would I take the mean value of a matrix and exclude only the one max value?
Thanks
0 commentaires
Réponse acceptée
Robert Dylans
le 9 Oct 2015
x=[1,2,3;4,5,6;7,8,500];
mean_value=(sum(x(:))-max(x(:)))/(numel(x)-1);
For 1d vectors rather than a matrix, you can exclude the (:) portions.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Get Started with MATLAB 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!