PCA algorithm by hand

(Any existing functions in MATLAB available?)