% plot Lagrange polynomials on [a,b] a = -1; b = 1; N = 7; % plot the interpolation points figure(1); clf; fs = 24; %font size grid on; xlabel('x', 'FontSize', fs); ylabel('y', 'FontSize', fs); axis([-1 1 -1 1]); hold on; % points for visualization Xf = linspace(a,b,100); ColorSet = lines(N); for i = 1:N, % form the Chebyshev polynomial i Ti = @(x) cos(i*acos(x)); % plot it plot(Xf,arrayfun(Ti,Xf),'-',... 'LineWidth',3,'Color',ColorSet(i,:)); if(i