P_DEG Function
Numerically determines the degree of a polynomial.
Usage
result = P_DEG(a)
Input Parameters
a—An array of coefficients of a polynomial.
Returned Value
result—The degree of the polynomial.
Keywords
Epsilon—Specifies a value above which P_DEG ignores higher order coefficients of the polynomial. If Epsilon is not set, the default value is based on the square root of machine epsilon.
Discussion
For a given polynomial A(z), such as:
A(z) = a0 + a1z–1 + a2z–2 + ... + aNzN
P_DEG determines M N such that ai Epsilon for i = M + 1, M + 2, ..., N.
Example
In this example, the degree of a polynomial A(z) = 5 + 4z–1 + 8z–2 + z–3 is computed with trailing zeros.
a= [5, 4, 8, 1, 0, 0, 0, 0]
PRINT, P_DEG(a)