k=4; %Number of data points n=k-1; %Degree of the poly x=randn(k,1); y=randn(k,1); cx=linspace(min(x),max(x)); %Get the coefficients for the interpolating poly: coefs=newtdd(x,y); cy=nest(n,coefs,cx,x); plot(x,y,'k*',cx,cy);