Taking mean without max values

3 ビュー (過去 30 日間)
Sammy
Sammy 2015 年 10 月 9 日
回答済み: Robert Dylans 2015 年 10 月 9 日
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 Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by