Exponents of the leading term of a polynomial
MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
degreevec(p
, <order
>) degreevec(f
, <vars
>, <order
>)
degreevec(p)
returns a list with the exponents
of the leading term of the polynomial p
.
For a polynomial in the variables x_{1}, x_{2}, …, x_{n} with the leading term x_{1}^{e1} x_{2}^{e2} … x_{n}^{en}, the exponent vector [e_{1}, e_{2}, …, e_{n}] is returned.
degreevec
returns a list of zeroes for the
zero polynomial.
If the first argument f
is not element of
a polynomial domain, then degreevec
converts the
expression internally to a polynomial of type DOM_POLY
via poly
(f)
.
If a list of indeterminates is specified, the polynomial poly
(f, vars)
is
considered. FAIL
is
returned if f
cannot be converted to a polynomial.
The leading term of the following polynomial expression (with
respect to the main variable x
) is x^{4}:
degreevec(x^4 + x^2*y^3 + 2, [x, y])
With the main variable y
, the leading term
is x^{2} y^{3}:
degreevec(x^4 + x^2*y^3 + 2, [y, x])
For polynomials of type DOM_POLY
, the indeterminates are an integral
part of the data type:
degreevec(poly(x^4 + x^2*y^3 + 2, [x, y])), degreevec(poly(x^4 + x^2*y^3 + 2, [y, x]))
For a univariate polynomial, the standard term orderings regard the same term as "leading":
degreevec(poly(x^2*z + x*z^3 + 1, [x]), LexOrder), degreevec(poly(x^2*z + x*z^3 + 1, [x]), DegreeOrder), degreevec(poly(x^2*z + x*z^3 + 1, [x]), DegInvLexOrder)
In the multivariate case, different polynomial orderings may yield different leading exponent vectors:
degreevec(poly(x^2*z + x*z^3 + 1, [x, z])), degreevec(poly(x^2*z + x*z^3 + 1, [x, z]), DegreeOrder)
degreevec(x^3 + x*y^2*z  5*y^4, [x, y, z], LexOrder), degreevec(x^3 + x*y^2*z  5*y^4, [x, y, z], DegreeOrder), degreevec(x^3 + x*y^2*z  5*y^4, [x, y, z], DegInvLexOrder)
The exponent vector of the zero polynomial is a list of zeroes:
degreevec(0, [x, y, z])

A polynomial of
type 
 

A list of indeterminates of the polynomial: typically, identifiers or indexed identifiers 

The term ordering: either 
List of nonnegative integers. FAIL
is returned if the input cannot
be converted to a polynomial.
f
, p