Section: Mathematical Functions
y = legendre(n,x)
where x is either a float or double array in range [-1,1], n is integer scalar. The output
vector y is the same size (and type) as x.
legendre function over the range [-1,1].
--> x = linspace(-1,1,30);
--> y = legendre(4,x);
--> plot(x,y); xlabel('x'); ylabel('legendre(4,x)');
which results in the following plot.