function cr=corr(A,len);
tic
[r,c]=size(A)
gem=sum(sum(A)')/(r*c);
cr(len)=0;
for jo=1:len;
	for io=1:c;
	cr(jo)=cr(jo) + sum((A(1:r-jo+1,io)-gem).*(A(jo:r,io)-gem));
	end;
end;
for jo=2:len;
cr(jo)=cr(jo)*r/(cr(1)*(r-jo+1));
end;
cr(1)=1;
toc
end;
