Taking mean without max values

Hello, How would I take the mean value of a matrix and exclude only the one max value?
Thanks

 Respuesta aceptada

Robert Dylans
Robert Dylans el 9 de Oct. de 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.

Más respuestas (0)

Categorías

Más información sobre Get Started with MATLAB en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 9 de Oct. de 2015

Respondida:

el 9 de Oct. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by