 100 rank(X)];
figure(5);clf
for ki=1:length(Ks)
  k = Ks(ki);
  %Xrecon = U(ndx,1:K) * S(1:K,1:K) * V(:,1:K)' + mu;
  Xrecon = Z(ndx,1:k)*V(:,1:k)' + mu;
  subplot(2,2,ki);
  imagesc(reshape(Xrecon', h, w)); axis off; colormap(gray)
  title(sprintf('reconstructed with %d bases', k))
end
printPmtkFigure(sprintf('pcaImages-%s-reconImages', name)); 


##### SOURCE END #####
--></body></html>