Ignore previous post. I have now got this to work by installing the statistics toolbox. Results are rather worrying, however, as it is filtering out 100% of my data points even though WinADV rates were only ~5% using the same filter!
21 Feb 2012
This function remove spike noise from data.
I created my own nanmean function as suggested by Georg Stillfried above. I then tried running func_despike_phasespace3d and found I needed a nanstd function. I tried this:
function m = nanstd (x,dim)
if nargin<2, dim=1; end
nans = isnan(x);
x(nans) = 0;
sumx = sum(x,dim);
m = sqrt((sumx./sum(~nans))/sum(~nans));
...but now getting back:
Error using *
Inner matrix dimensions must agree.
Error in func_excludeoutlier_ellipsoid3d (line 97)
x2 = a*b*c*x1/sqrt((a*c*y1)^2+b^2*(c^2*x1^2+a^2*z1^2));
Error in func_despike_phasespace3d (line 101)
[xp,yp,zp,ip,coef] = func_excludeoutlier_ellipsoid3d(f,f_t,f_tt,theta);
...what have I done wrong?
Great code, but not applicable to my type of images. I'm trying to make the threshold automated since I have a hundred thousands of this kind. I appreciate any suggestions.