A=[1 3;4 2]/4; A svd(A) [U,S,V] = svd(A) A - U*S*V' A=rand(4,2); [U,S,V] = svd(A) U'*U [U,S,V] = svd(A,0) cd yalefaces/ size(A) X=imread('subject01.wink','gif'); X=double(X); size(X) prod(ans) image(X) colormap(flipud(gray(256))) colormap(gray(256)) shg image(reshape(A(:,1),243,320)) shg [U,S,V] = svd(A,0); size(U) size(S) size(V) semilogy(diag(S)) shg pcolor(reshape(U(:,1),243,320)),axis ij, shading flat shg pcolor(reshape(U(:,2),243,320)),axis ij, shading flat shg X=imread('subject01.glasses','gif'); image(X) shg x=X(:); c = U'*x x=double(X(:)); c = U'*x plot(c) shg pcolor(reshape(U*c,243,320)),axis ij, shading flat shg pcolor(reshape(U(:,1:10)*c(1:10),243,320)),axis ij, shading flat shg subplot(1,2,1) pcolor(reshape(U*c,243,320)),axis ij, shading flat subplot(1,2,2) pcolor(reshape(U*c,243,320)),axis ij, shading flat pcolor(reshape(U(:,1:10)*c(1:10),243,320)),axis ij, shading flat shg pcolor(reshape(U(:,1:20)*c(1:20),243,320)),axis ij, shading flat shg