FreeMat

- Main Page
- Related Pages

LEGENDRE Associated Legendre Polynomial

Section: Mathematical Functions

# Usage

Computes the associated Legendre function of degree n.

      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`.

# Example

Here is a plot of the `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.