The code looks fine. I actually don't see what your problem is? If you
would like to display your eigenfaces you just have to reshape your
eigenfaces back to the original size (from vector to matrix) and
dislpay them as an image (scaled to the 8bit interval for example). In
matlab you would do something like this:
[a,b]=size(img);
eigenface_one = reshape(eigen_faces(:,1),[a,b]);
imshow(eigenface_one,[])
However, this is just necessary for visualization purposes. For
computing the PCA features you don't have to do that. You just use
youreigenfaces as a projection matrix:
PCA_coeff = diffr_mat'*eigen_faces;
Hope this helps.