﻿功能:求Legendre多项式(Legendre polynomials)

格式:
PolyLegendre(n,x)
PolyLegendre(n)

n:一个不小于0的整数变量,表示求Legendre多项式的最高次数
x:矩阵变量或者数据变量,当为矩阵变量时,多矩阵中每个元素进行操作.相当于求Legendre多项式中变量值为x对应的值

说明:
1. 只传入n参数时,返回符号表达式
2. 传入n,x时,将计算n次Legendre多项式在x处的值
3. 具体原理如下
$$
\begin{cases}
L_0(x) &= 1
\\
L_1(x) &=
\\
L_2(x) &=1.5x^2-0.5
\\
(n+1)L_{n+1}(x)&=(2n+1)xL_n(x)-nL_{n-1}(x)
\end{cases}
$$

关于:{Legendre多项式<http://en.wikipedia.org/wiki/Legendre_polynomials>}

例子:

f = PolyLegendre(3)//执行得到如下结果
f =
{-1.5*x+2.5*x^3 }
