Taking mean without max values

3 次查看(过去 30 天)
Hello, How would I take the mean value of a matrix and exclude only the one max value?
Thanks

采纳的回答

Robert Dylans
Robert Dylans 2015-10-9
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 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by