% Tund 13, ülesanne 3
x=[-1:0.1:-0.3];
y=[10,11,11.5,11.6,11.4,11.1,10,8.7];
% a) integraali trapetsvalemiga
trapz(x,y)
plot(x,y,'o')
hold on
xvork=[-1:0.001:-0.3];
y3splain=interp1(x,y,xvork,'spline') % S^(3,2)(xvork);
plot(xvork,y3splain,'b-')
hold off
f=@(z) interp1(x,y,z,'spline');
integral(f,-1,-0.3)