% Harjutustund 10, ylesanne 2
x=[0:0.25:1.25];
y=[0,25,49.4,73,96.4,119.4];
plot(x,y,'o')
% a) l2hendame andmeid lineaarsplainiga
ys1=interp1(x,y,x,'linear');
hold on
plot(x,ys1)

% b) l2hendame andmeid kuupsplainiga S^(3,2)(x)
xx=[0:0.01:1.25];
ys3=interp1(x,y,xx,'spline');
hold on
plot(xx,ys3)

% c) aeg 0.45 miili l2bimiseks
interp1(x,y,0.45,'linear')
interp1(x,y,0.45,'spline')