0

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

Bernard
  • 175,478
Tomas
  • 3
  • "X", I presume, must be defined and I am not sure why would it be the same as the coordinate "x" in line 4 of your algorithm. I think it will be better if you add your MATLAB script – Snifkes Aug 09 '18 at 12:47
  • You should always use iteration with a for loop in a case such as this. I am not sure MATLAB does recursion, but if it does, then for loop should not be used. – Somos Aug 09 '18 at 14:32

0 Answers0