Sorted list of monomials 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.
monomials(p, order) returns the list of non-zero
monomials of the polynomial
p. The list is sorted
with respect to the term ordering
monomials returns a list of all non-trivial
monomials of the polynomial given. The monomials are sorted according
to the term ordering given. The list is empty if the polynomial is
A polynomial expression
f is first converted
to a polynomial with the variables given by
If no variables are given, they are searched for in
details of the conversion. The result is returned as list of polynomial
f cannot be converted to a polynomial.
We give some self explaining examples:
p := poly(100*x^100 + 49*x^49 + 7*x^7, [x]): monomials(p)
We demonstrate the effect of various term orders:
p := poly(5*x^4 + 4*x^3*y*z^2 + 3*x^2*y^3*z + 2, [x, y, z]): monomials(p)
This example features a user defined term ordering. Here we use the reverse lexicographical order on 3 indeterminates:
order := Dom::MonomOrdering(RevLex(3)): p := poly(5*x^4 + 4*x^3*y*z^2 + 3*x^2*y^3*z + 2, [x, y, z]): monomials(p, order)
delete order, p:
We demonstrate the evaluation strategy of
p := poly(3*x^3 + 6*x^2*y^2 + 2, [x]): y := 4: monomials(p)
Evaluation is enforced by
map(%, mapcoeffs, eval)
delete p, y:
The term ordering:
List of polynomials of the same type as
A list of expressions is returned if an expression is given. The list
is empty if the polynomial is zero.