Taking mean without max values

조회 수: 5 (최근 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 CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by