<< CL_lagrangeFitPoly Math CL_mean >>

CelestLab >> Math > CL_legendrePoly

CL_legendrePoly

Legendre polynomials

Calling Sequence

[p, pdot, p2dot] = CL_legendrePoly(n)

Description

Parameters

n:

(integer) Degrees of the polynomials in [0,100] (PxQ)

p:

Legendre polynomials (same size as n)

pdot:

First derivative of the polynomials (same size as p)

p2dot:

Second derivative of the polynomials (same size as p)

Authors

Examples

// Generate Legendre polynomials (degree 0 to 5) and plot them
n = 0:5;
p = CL_legendrePoly(n);
t = linspace(-1,1,100);
scf();
plot(t, horner(p',t));
CL_g_legend(gca(), "degree: " + string(n));

Report an issue
<< CL_lagrangeFitPoly Math CL_mean >>