从mathworks 的帮助中举这个例子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.
为什么即使文档说平均值可以在as的任何维度dim
上取值,它也会显示错误?谢谢。X
y = nanmean(X,dim)