Hi am trying to prove using the recursive formula that the legendre polynomial P3(x)=(1/2)*(5x^3 - 3x) .......(1)
This is the recursive formula
where P2=(1/2)(3x^2 - 1) and P1=x
we have chosen k=2 so it gives Pk+1 = P3.
Everytime I try to evaluate this by hand, I dont get equation (1), which is what I need, can someone help me on this.
I even tried matlab which gave an ans = 45/4*x^3-27/4*x, which is still not (1).
Hi, I am having trouble getting this legendre function to work in Matlab now. I am suppose to create a for-loop containing the recursion equation to create a vector called P, containing simplified symbolic formulae for the legendre polynomials from degree 1 up to degree 10. firstly I included the first two degree
here is my matlab code of I tried to do:
syms x k
I keep getting this error from Matlab:
??? In an assignment A(I) = B, the number of elements in B and
I must be the same.
Error in ==> legendrepoly at 4
But: you want x to be a symbolic variable, but you have assigned it to a numeric array (which may be arbitrary precision or floating point; I don't know) which I'm pretty sure is nonsense.
(and note opalg's comment about loop indices)