Legendre polynomials plot help
显示 更早的评论
Hi,
I need to plot the first 5 legendre polynomials. I have managed to get the expressions by writing a code for it.
>>syms x b
for n = 1:5
a(n) = 1./((2.^(n-1)).*factorial(n-1));
b = ((x*x)-1).^(n-1);
c = diff(b,n-1);
P_n = a(n).*c
end
But now I can't figure out how to write a code to calculate its value for x varying from -1 to 1 with an increment of 0.1.
Any ideas would be highly appreciated.
Thanks
Ushnik
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 2-D and 3-D Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!