


GMEAN just like mean, except that it skips over bad points
Usage: xnew=gmean(x);
x can be a vector or matrix

0001 function xnew=gmean(x) 0002 % GMEAN just like mean, except that it skips over bad points 0003 % Usage: xnew=gmean(x); 0004 % x can be a vector or matrix 0005 [imax,jmax]=size(x); 0006 if(imax==1), 0007 imax=jmax; 0008 jmax=1; 0009 x=x.'; 0010 end 0011 for j=1:jmax 0012 good=find(finite(x(:,j))); 0013 if length(good)>0 0014 xnew(j)=mean(x(good,j)); 0015 else 0016 xnew(j)=NaN; 0017 end 0018 end