X = linspace(-2,2,10); Y = 1./(1+25*X.^2); [P,R,S] = lagrangepoly(X,Y); xx = -2.5:.01:2.5; plot(xx,polyval(P,xx),X,Y,'or',R,S,'.b'); grid;