Can anyone please tell me how when using an if statement and taking the mean of a vector of any size. when I take the mean of the vector I am asked if the vector has more than 6 elements exclude the min and max. But if the min or max occurs more than once only exclude it once.
so far I have …
function ave = improvedMean(V1)n = length(V1)if n>0 %%n<= 5
sum(V1) / nelseif n >= 6 ((sum(v1)-((min(v1)+(max(v1))) / (n-2)
I'm not sure where to go from there..
Best Answer