function [coef] = Newton_Divided_Difference(x, fun_val)

n     = length(x); 
mtx_F = zeros(n,n);

for ii = 1:n
    mtx_F(ii,1) = fun_val(ii);
end

for ii = 2:n
    for jj = 2:ii
        mtx_F(ii,jj) = ( mtx_F(ii,jj-1) - mtx_F(ii-1,jj-1) ) / ( x(ii) - x(ii-jj+1) );
    end
end

coef = diag(mtx_F);