Code covered by the BSD License
function out=proj(v) out=(1/dot(v,v))*v*v';
Contact us at files@mathworks.com