

A=rgb2gray(imread('baboon.png'));
A=double(A);
[U,S,V]=svd(A);
k= 30;
Ak=U(:,1:k)*S(1:k,1:k)*V(:,1:k)';
colormap('gray');
imagesc(Ak);
axis equal;