clear all; close all; % Check polynomial interpolation using lower order polynomials. n= input('Input number of nodes = '); k= input('Input the degree of polynomials < n = '); x=1:n; y=x.^k; p = newton(x,y); h = (max(x)-min(x))/(3*n); x2 = min(x):h:max(x); ye = x2.^k; N2 = length(x2); for i=1:N2, pn(i) = eval_newton(x,p,x2(i)); end plot(x2,ye-pn)