%Lecture14a
%Polynomial Interpolation


t=[1:6];

f=[1 3 2 4 6 7];

figure(1)
plot(t,f,'ro')
axis([0 7 0 10])
xlabel('t')
ylabel('f(t)')
title('Data')

tint=[0:0.01:7];
for i=0:5
	[P,S]=polyfit(t,f,i);

	yint=polyval(P,tint);

	figure(2)
	plot(t,f,'ro',tint,yint,'b-')
	axis([0 7 0 10])
	xlabel('t')
	ylabel('f(t)')
   title(['Polynomial Interpolation - Order ',int2str(i)])
   pause
end

