


X get index cell in each column that is the center of the [m n] moving window


0001 function n=testfilter(X,f) 0002 %X 0003 % get index cell in each column that 0004 % is the center of the [m n] moving window 0005 i=ceil(size(X,1)/2); 0006 n = X(i,:); 0007 0008 % find center cells that are > 0 0009 c = find(X(i,:)>0); 0010 n(c(any(X(:,c)==0)))=n(c(any(X(:,c)==0)))*f; 0011 % for z=c 0012 % if any(X(:,z)==0); 0013 % n(z)=n(z)*f; 0014 % end 0015 % end