x=[2:12];
la=[];h=[];
f(x)=[0.25 3.86 6.36 -4.14 -24.1 -25.4 12.6 61.7 56.9 -27.3 -122.9];
d(x)=[1.53 4.94 -2.42 -18.2 -16.4 18.1 53.1 32.7 -47.5 -107.7 -60.1];
p=polyfit(x,f(x),6);
P=poly2str(p,'x');
p1=polyval(p,x);
subplot(3,1,1);
plot(x,p1,'k-*');
for i=2:12
h(i-1)=Hermite(x,f(x),d(x),i);
end
for i=2:12
la(i-1)=lagrange(x,f(x),i);
end
subplot(3,1,2);
plot(x,h,'r-o');
subplot(3,1,3);
plot(x,la,'b--');