blob: 9fb608a0349b0941ff843aa7fdd6261382d587aa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
//page 155
clear;
close;
clc;
b=[1;2;3];
disp(b,'b=');
a=[1;1;1];
disp(a,'a=')
x=(a'*b)/(a'*a)
disp(x*a,'Projection p of b onto the line through a is x^*a=');
disp((a'*b)/(sqrt(a'*a)*sqrt(b'*b)),'cos(thetha)=');
//end
|