Owning Class: advanced
Requires: MathScript RT Module
y = legendre(n, x)
y = legendre(n, x, type)
Computes the associated Legendre functions of a given degree.
| Name | Description | ||||||
|---|---|---|---|---|---|---|---|
| n | Specifies the degree of the Legendre function. n is a positive integer. | ||||||
| x | Specifies the values at which to evaluate the Legendre function. x is a vector of double-precision, floating-point numbers. x must be between -1 and 1. | ||||||
| type | Specifies the type of the Legendre function. type is a string that accepts the following values.
|
| Name | Description |
|---|---|
| y | Returns the Legendre function of degree n and order 0, 1, ... , n, evaluated for each element of x. If x is a vector of length m, y is an (n+1)-by-m matrix. The (i, j)-th element of y is the associated Legendre function of degree n and order i evaluated for the j-th element of x. |
Y = legendre(4, [-0.5, 0, 0.5]);