1 2 3 4 5 6 7 8 9
disp('Vectors u an v are:') u=[-1;2] v=[4;6] disp(v,u) disp('Projection of v on u=(u.v)/(v.v)') a=u'*v b=u'*u p=a/b disp(p,'=')