% Harjutustund 14, ylesanne 7
x=[1:0.5:5];
y=[0,10,18,25,32.2,39,43,48,52.3];
plot(x,y,'o')
trapz(x,y)
% n2iteks leiame pindala ka Simpsoni valemiga
% ehk interpoleerime andmeid S^(3,2)(x)
y3splain=interp1(x,y,x,'spline');
hold on
plot(x,y3splain)
f=@(z) interp1(x,y,z,'spline');
integral(f,1,5)