d\n'</span>);
<span class="comment">%[U,S,V] = svd(XC,0);</span>
<span class="comment">%evals = (1/n)*diag(S).^2;</span>
[V, Z, evals] = pcaPmtk(X);

<span class="comment">% visualize basis functions (eigenfaces)</span>
figure(2);clf
subplot(2,2,1)
imagesc(reshape(mu,[h w])); colormap(gray); axis <span class="string">off</span>;
title(<span class="string">'mean'</span>)
<span class="keyword">for</span> i=1:3
  subplot(2,2,i+1)
  imagesc(reshape(V(:,i),[h w])); colormap(gray); axis <span class="string">off</