function body_proloz
% prolozeni bodu o souradnicich x,y
x=1:5;
y=[10,12,15,16,18];
xj=min(x):0.1:max(x);
y2=polyval(polyfit(x,y,2),xj);
plot(x,y,'x',xj,y2)
disp('Hodnota v bodu 2.5')
disp(polyval(polyfit(x,y,2),2.5))
disp('Koef. polynomu')
disp(polyfit(x,y,2))
yi=interp1(x,y,xj,'spline');
hold on
plot(xj,yi)
hold off
legend('body','polynom 2 st.','prolozeni spline','Location','SouthEast')
end

