MATLAB: Why nanmean error

nanmeanobsolete function

Hi all,
I am trying to average 3d matrix that have nan values, but I am getting the following error:
Error using nanmean
Too many input arguments.
and the resulted matrix when i used mean function it doesn't show any data
any suggestion?
Thanks u

Best Answer

You may have your own function or a variable that you named ‘nanmean’.
Run this from a script or your Command Window:
which nanmean -all
If the first result is:
nanmean is a variable.
You have found the problem. The solution is to re-name your function or variable to something that does not overshadow any MATLAB functions, and is meaningful to you.
Related Question