blob: bdb82fa13aada9615969684fe74c681d8e460561 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
disp('Vectors y and u are:')
y=[2;3]
u=[4;-7]
disp(u,y)
disp('The orthogonal projection of y on u=((y.u)/(u.u))*u')
a=y'*u
b=u'*u
c=(a/b)*u
disp(c,'=')
disp('The component of y orthogonal to u is:')
disp(y-c)
|