The projection matrix P of any matrix A could be found by formula P = A*inv(A'*A)*A';
My question,Is there any built in matlab function that can give the projection matrix of
any matrix...
I think that such standard built-in function is not available. Of course, this function can be easily compiled from basic Matlab matrix functions.
See for example here: MATLAB Teaching Codes
and read the M-file projmat.m