% Harjutustund 10, ülesanne 3
x=[0:pi/4:2*pi];
y=cos(x);
disp([x;y])
plot(x,y,'o')
% lineaarsplain
ys1=interp1(x,y,x,'linear');
hold on
plot(x,ys1,'r-')
% kuupsplain
xx=[0:pi/15:2*pi];
ys3=interp1(x,y,xx,'spline');
hold on
plot(xx,ys3)
% y=cosx
y=@(x) cos(x);
fplot(y,[0,7])