%MATLAB-skript ls_intro.m
Phi=[1, 1
   2, 1
   3, 1];
y=[0.8
   3
   4];
theta_lsformel=inv(Phi'*Phi)*Phi'*y
theta_slash=Phi\y
x=x_slash;
figure(1),clf
plot(Phi(:,1),y,'*')
hold on
xx=[0:4]';
yy=x(1).*xx+x(2);
plot(xx,yy)
hold off
xlabel('x')
ylabel('z')