%Lecture14a
%Polynomial Interpolation


t=[1:6]

f=[1 3 2 4 6 7]

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

[P,S]=polyfit(t,f,1)

y=polyval(P,t)

figure(2)
plot(t,f,'ro',t,y,'b-')
axis([0 6 0 10])
xlabel('t')
ylabel('f(t)')
title('Polynomial Interpolation')
