clc, clear all,clf;
x=[0 1 3 4]';
y=[1 8 11 20]';
plot(x,y,'*')
hold on

%% a
A1=[x ones(size(x))];
k1=A1\y
r1=A1*k1-y
plot(x, A1*k1)

pause
%% b
A2=[ones(size(x))];
k2=A2\y
r2=A2*k2-y
plot(x, A2*k2)
pause
%% c
A3=[x];
k3=A3\y
r3=A3*k3-y
plot(x, A3*k3)
