
function coeff=newt_intp(x,fx)

coeff=fx;
n=length(fx)-1;

for j=1:n
    nums=diff(coeff(j:end,end));
    dens=x(j+1:end)-x(1:end-j);
    coeff_loc=[zeros(j,1); nums./dens];
    coeff=[coeff coeff_loc];
end



