clf
clear all;
L=4;
N=50;
%X(1,:)=L*rand(1,N);
X(1,:)=L*rand(1,N);
X(2,:)=(X(1,:)+((1/2)-rand(1,N))/2).^2;
A=ones(2,N);
A(2,:)=X(1,:);
Y=X(2,:)
C=inv(A*A');
B=C*A*Y'
j=L*(0:N)/N;
figure(5)
plot(X(1,:),X(2,:),'r*')
hold on
l=B(1)+B(2)*j
plot(j,l)
%axis([0 L 0 L])