ce Demo
% Based on code by Mark Girolami
%%

% This file is from pmtk3.googlecode.com

requireImageToolbox
loadData('facesOlivetti');
h = 112; w = 92;

% plot the first 25 faces as a single image
figure;
N = 25;
XtrainImg = zeros(h,w,1,N);
for i = 1:N
  XtrainImg(:,:,1,i) = reshape(Xtrain(i,:), [h w]);
end
montage(XtrainImg); 
title(sprintf('first %d training images', N))
%for i=1:25
%  subplot(5,5,i)
%  f = reshape(X(i,:), [h w]);
%  imagesc(f);
%  axis off
%end
%colormap gray

Selected_Face = 125;%312;%25