Take this example from the mathworks help of nanmean():
X = magic(3);
X([1 6:9]) = repmat(NaN,1,5)
X =
NaN 1 NaN
3 5 NaN
4 NaN NaN
>> y = nanmean(X,2)
??? Error using ==> nanmean
Too many input arguments.
Why is it showing error even when the docs say the mean can be taken in any dimension dim of X as y = nanmean(X,dim)? Thanks.
I run exactly the code you have and I get no error. In particlar here is what I ran:
The only thing I can think of is that you have a different version of
nanmean.mon your path. Try awhich nanmeanand see if it points into the stats toolbox.