Chebyshev's polynomial approximation

147 Views Asked by At

Please help me with this question. I want to run a system that will give me answer using MATLAB but I am struggling.

Write a function Cheb(n,x) for evaluating $T_n(x)$. Use the recursive formula satisfied by the Chebyshev's polynomials. Test the program on these 15 cases: n = 0,1,3,6,12 and x = 0,−1,0.5.

I am using the following pseudo code:

Real function cheb(n,X)

Integer n=15, j=0

Real X, $T_0=1,T_1=X$

For j>=2 do $T_j= 2xT_{j-1}(X)-T_{j-2}(X)$

Output $T_j$

End for

End