% Selective mean: mean of all values above a threshold. % Other values are ignored. function y = selectiveMean(vector, threshold) % Select elements that are above the threshold list = find(vector > threshold); y = mean(vector(list));