function im=mu2im(mu,p)

% convert cluster centroids into little images

if nargin <2,

		   p=5; % p x p image features

end



[k,d]=size(mu);



for i=1:k,

    for j=1:p,

        im(j,1:p,i)=mu(i,1+(j-1)*p:j*p);

    end

end