clf
load 'regress.mat'
N=length(X);
A=[ ones(1,N); X(1,:); X(1,:).^2];
P=A*A'
Y=A*X(2,:)'
B=inv(P)*Y

j=4*(0:N)/N;
%B(1)=3;% change this from your computations
%B(2)=-3;% change this from your computations
%B(3)=2;% change this from your computations
plot(X(1,:),X(2,:),'r*')
hold on
l=B(1)+B(2)*j+B(3)*j.^2;
plot(j,l)
