function outv=mymean(vec)
mysum=0;for i=1:length(vec) mysum=mysum+vec(i);endoutv=(mysum-max(vec)-min(vec))/(length(vec)-2);if ismember(vec,unique(vec))==(ismember(unique(vec),vec))outv=mean(vec);end
Task: Write a function that will return the mean of the values in a vector, not including the minimum and maximum values. Assume that the values in the vector are unique. It is OK to use the built-in mean function.
Best Answer