Warning, /utils/matlab/Graphix/GraphixUtility/meanovernan.m is written in an unsupported language. File is not indexed.
view on githubraw file Latest commit 892fe9e2 on 2005-10-19 20:09:14 UTC
892fe9e2f3 Dani*0001 function y = meanovernan(x,dim)
0002
0003 xsize = size(x);
0004 xflat = reshape(x,[prod(xsize),1]);
0005 nanindex = isnan(xflat);
0006 xflat(nanindex) = 0;
0007 nanindex = reshape(~nanindex,xsize);
0008 xtemp = reshape(xflat,xsize);
0009 warning off MATLAB:divideByZero
0010 y = sum(xtemp,dim)./sum(nanindex,dim);
0011 warning on MATLAB:divideByZero