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);
disp(k)
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,'g')
plot(xj,yi,'m')
legend('body','polynom 2.stupne','polynom 9.stupne','spline','Location','South')
hold off
r=sprintf('%.3f x^2 %+.3f x %+.3f',k(1),k(2),k(3));
title(r)
fprintf('%.3f x^2 %+.3f x %+.3f\n',k(1),k(2),k(3));
end


