www.pudn.com > residues.rar > residues.m, change:2010-06-19,size:521b


function nres=myresidues(phasematrix) 
%phase Ϊλֵ 
[L P] = size(phasematrix); 
nres=0; 
for ii=1:L-1 
    for jj=1:P-1 
      residue = wrap(phasematrix(ii+1,jj  ) - phasematrix(ii  ,jj  )) + ... 
                wrap(phasematrix(ii+1,jj+1) - phasematrix(ii+1,jj  )) + ... 
                wrap(phasematrix(ii  ,jj+1) - phasematrix(ii+1,jj+1)) + ... 
                wrap(phasematrix(ii  ,jj  ) - phasematrix(ii  ,jj+1)); 
        if (abs(residue) > 0.1) 
            nres = nres + 1; 
        end  
    end 
end