MATLAB: Taking mean without max values mean max Hello, How would I take the mean value of a matrix and exclude only the one max value? Thanks Best Answer 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. Related SolutionsMATLAB: Mean value of array between values Yes, your thought is right mean_value_ex = (sum(a(:))-(max(a(:))+min(a(:)))/ (numel(a)-2)) MATLAB: How to find the raw mean value of matrix mean() also accepts the dimension in which you want to operatex = [1 2 3 4; 5 6 7 8;10 11 13 14;];row_mean = mean(x, 2);[~, idx] = max(x, [], 'all', 'linear');[~, max_col] = ind2sub(size(x), idx) Related QuestionMaxHow to find the raw mean value in matrixMeanFinding the mean/average of the smallest values in a row
Best Answer