function interpol_demo(x,f)

n=length(x)-1;
om=poly(x);
omd=polyder(om);
xx=linspace(min(x),max(x));
omf=polyval(om,xx);
x0=zeros(size(x));
plot(x,x0,'*',xx,omf)
title('Polynom \omega_n_+_1')
pause
P=zeros(size(x));
for ii=0:n;
    xp=x(ii+1);
    lp=deconv(om,[1,-xp])/polyval(omd,xp);
    lpf=polyval(lp,xx);
    plot(x,x0,'*',xx,lpf)
    title(['Fundamentalni polynom l_',num2str(ii)])
    P=P+f(ii+1)*lp;
    pause
end
Pf=polyval(P,xx);
plot(x,f,'*',xx,Pf)
title('Interpolacni polynom')