function prolozeni_bodu
x=[1:9];
y=[1:5,4:-1:1];
plot(x,y,'ro')
xj=[min(x):0.1:max(x)];
k=polyfit(x,y,2);
y2=polyval(k,xj);
y9=polyval(polyfit(x,y,9),xj);
yi=interp1(x,y,xj,'spline');
hold on
plot(xj,y2,'k')
plot(xj,y9,'b')
plot(xj,yi,'g')
legend('body','polynom 2.stupne','polynom 9.stupne','spline','Location','NorthWest')
hold off
disp(k)
r=sprintf('%.2fx^2 %+.2fx %+.2f',k(1),k(2),k(3));
title(r)
end


