function InterpolaceMonomialy()

N = 100;
x = 0:1:N;
f = rand(N+1,1);

AN = zeros(N+1,N+1);
for i=0:N
    for j=0:N
        AN(i+1,j+1) = x(i+1)^j;
    end
end     

for n=0:N
    An = AN(1:(n+1),1:(n+1));
    cond(An)
    alfa = An\f(1:(n+1));
    xx = 0:0.1:n;
    fn = xx; fn(:) = 0;
    for j=0:n
        fn = fn + alfa(j+1)*xx.^j;
    end
    plot(xx,fn,'r',x(1:(n+1)),f(1:(n+1))','kx')
    pause
end