Recursively find the coefficients of Chebyshev polynomials \(T_n\) for \(n\le 6\text{.}\) Plot all of them on the interval \([-1, 1]\text{.}\)
Answer.
This is a straightforward modification of Example 15.4.1.
p = [1];
q = [1 0];
x = linspace(-1, 1, 1000);
hold on
plot(x, polyval(p, x), x, polyval(q, x));
for n = 1:5
r = 2*[q 0] - [0 0 p];
p = q;
q = r;
plot(x, polyval(r, x))
end
hold off

