%MATLAB script for testing the function CHEB for example 6.10 on page 258 of conte/deboor
% as test we compute and plot the Chebyshev polynomials of degree <=4
% using the fact that CHEB has been written to handle simultaneous evaluation
% at all the entries of the input vector X .
%
% Reference:
%
% Samuel Conte, Carl de Boor,
% Elementary Numerical Analysis,
% Third Edition,
% SIAM, 2017,
% ISBN: 978-1-611975-19-2.
%
X = -1:.02:1;
c = eye(5);
plot([-1.2 1.2 1.2 -1.2,-1.2],[-1.2 -1.2 1.2 1.2 -1.2]), hold on
for j=1:5
plot(X, CHEB(c(:,j),X))
end
axis off
title('The Chebyshev polynomials of degree < 5')
hold off