% Kemiallinen koe
X=[-1 -0.96 -0.86 -0.79 0.22 0.5 0.93];
Y=[-1 -0.151 0.894 0.986 0.895 0.5 -0.306];

plot(X,Y,'o')

axis([-1.2 1 -1.4 1.2])
grid on

c=polyfit(X,Y,6);
x=linspace(-1,1);
y=polyval(c,x);
hold on
plot(x,y)
z=spline(X,Y,x);
plot(x,z,'r')

