legendreP
勒让德多项式
说明
示例
求 5.6 处的 3 次勒让德多项式。
y = legendreP(3,5.6)
y = 430.6400
求 x 处的 2 次勒让德多项式。
syms x
y = legendreP(2,x)y =
如果您未为次数 n 指定数值,legendreP 函数便无法求出多项式的显式形式,并且将返回函数调用。
syms n
y = legendreP(n,x)y =
通过设置 n = [1 2] 求 1 次和 2 次勒让德多项式。
syms x
y = legendreP([1 2],x)y =
legendreP 对 n 按元素进行操作,返回包含两个元素的向量。
如果将多个输入指定为向量、矩阵或多维数组,则这些输入的大小必须相同。求输入参量 n 和 x 均为矩阵时的勒让德多项式。
n = [2 3; 1 2]; xM = [x^2 11/7; -3.2 -x]; yM = legendreP(n,xM)
yM =
legendreP 对 n 和 x 按元素进行操作,返回与 n 和 x 大小相同的矩阵。
使用 limit 求 3 次勒让德多项式在 x 趋于 时的极限。
syms x
P3 = legendreP(3,x);
P3 = limit(P3,x,-Inf)P3 =
使用 diff 求 5 次勒让德多项式的三阶导数。
P5 = legendreP(5,x); D3P5 = diff(P5,x,3)
D3P5 =
绘制 1 次到 4 次勒让德多项式。
syms x y fplot(legendreP(1:4, x)) axis([-1.5 1.5 -1 1]) grid on ylabel('P_n(x)') title('Legendre polynomials of degrees 1 through 4') legend('1','2','3','4','Location','best')

输入参数
多项式的次数,指定为非负数、向量、矩阵、多维数组、符号数、符号向量、符号矩阵、符号函数或符号多维数组。非标量输入的所有元素均应为非负整数或符号。
输入,指定为数字、向量、矩阵、多维数组、符号数、符号向量、符号矩阵、符号函数或符号多维数组。
输出参量
勒让德多项式,以数字、向量、矩阵、多维数组、符号数、符号向量、符号矩阵、符号函数或符号多维数组形式返回。
详细信息
勒让德多项式定义如下
勒让德多项式满足以下递归公式
勒让德多项式在区间 [-1,1] 内关于权重函数 w(x) = 1 正交,其中
与盖根鲍尔多项式 G(n,a,x) 的关系如下
与雅可比多项式 P(n,a,b,x) 的关系如下
版本历史记录
在 R2014b 中推出
另请参阅
chebyshevT | chebyshevU | gegenbauerC | hermiteH | hypergeom | jacobiP | laguerreL
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)