1

How do I easily compare coefficients of two polynomials in MuPad?

4

1 回答 1

1

Here's my solution, which defines operators such as =s^1=; this operator compares the s^1 coefficient. Code should be pretty easy to modify.

eqcoeff := (x, i, a, b) -> coeff(a, x, i) = coeff(b, x, i):
for n from 0 to 6 do
    operator("=s^" . n . "=", fp::curry(eqcoeff, 3)(s)(n), Binary, 1):
end:

// for example:
4*s+3 =s^0= 4*s+7; // 3=7
4*s+3 =s^1= 4*s+7; // 4=4
于 2015-02-20T16:06:17.873 回答