Create a polynomial using b-adic expansion
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.
genpoly(n, b, x) creates a polynomial
p in the
x from the
n, such that p(b)
= n. The integer coefficients
of the resulting polynomial are greater than and
less than or equal to .
expansion of an integer n is
defined by ,
such that the ci are
symmetric remainders modulo b,
all i (see
mods). From this expansion
the polynomial is
created. The polynomial is defined over the coefficient ring
If the first argument of
genpoly is a (multivariate) polynomial, then it must be defined over
the coefficient ring
Expr and must have only integer coefficients.
The third argument
x must not be a variable of
the polynomial. In this case each integer coefficient is converted
into a polynomial in
x as described above. The
result is a polynomial in the variable
by the variables of the given polynomial. (
the main variable of the returned polynomial.)
The first argument
n may also be a polynomial expression.
In this case, it is converted into a polynomial using
applied as described above, and the result is again converted into
a polynomial expression.
If the first argument is an integer or a polynomial, then the
result is a polynomial of domain type
DOM_POLY; otherwise it
is a polynomial expression.
We create a polynomial
p in the indeterminate
p(7) = 15. The coefficients of
p := genpoly(15, 7, x)
Here is an example with a polynomial expression as input:
p := genpoly(15*y^2 - 6*y + 3*z, 7, x)
The return value has the same type as the first argument:
p := genpoly(poly(15*y^2 + 8*z, [y, z]), 7, x)
We check the result:
p(7, y, z)
An integer greater than 1
The indeterminate: an identifier