N=10;
x=[1.1 2.1 3.1 4.1 5.1 6.1 7.1 8.1 9.1 10.1];
y=[-9 -11 -14 -9 -5 -3 -1 1 2.1 4];
plot(x,y,'*r',x,y,'ok');
col=['r','g','b','k','m','c'];
pause;
grid;
hold on;
for n=1:9
p=polyfit(x(1:n+1),y(1:n+1),n);
f=polyval(p,[x(1):0.01:x(N)]);
plot([x(1):0.01:x(N)],f,col(n));
end;
grid;
hold off;