function D=clim(y)

% takes grayscale image y and converts into a bunch

% of 25 dimensional vectors, corresponding to the 

% entire set of 5x5 feature patches for this particular

% image



% appears to be fine!



  [m,n]=size(y);



% was (m-5)(n-5)

D=zeros((m-4)*(n-4),25); %set up data matrix



for i=1:(m-4),

    fprintf('%d\n',i)

  for j=1:(n-4),

	D(i +(j-1)*(m-4), 1:5)=y(i,j:(j+4));

	D(i +(j-1)*(m-4), 6:10)=y(i+1,j:(j+4));

	D(i +(j-1)*(m-4), 11:15)=y(i+2,j:(j+4));

	D(i +(j-1)*(m-4), 16:20)=y(i+3,j:(j+4));

	D(i +(j-1)*(m-4), 21:25)=y(i+4,j:(j+4));

end

end





 

