% Harjutustund 9, ylesanne 6
x=[-1,0,1,2];
y=[3,-4,5,-6];
plot(x,y,'o')
axis([-3,5,-8,7])
yline(0)
xline(0)
grid on
% Lagrange'i interpolatsioonipolynoom
% leiame polynoomid L_(n,i)(x)
a=conv([1,0],[1,-1])
conv(a,[1,-2])
l0=poly([0,1,2])
l1=poly([-1,1,2])
l2=poly([-1,0,2])
l3=poly([-1,0,1])