Forgot password?
 Create new account
View 659|Reply 0

获取多元多项式的次数

[Copy link]

462

Threads

969

Posts

9934

Credits

Credits
9934

Show all posts

青青子衿 Posted at 2019-6-18 15:24:21 |Read mode
Last edited by 青青子衿 at 2019-6-18 15:32:00
  1. coefs = CoefficientList[
  2.    x^3*y + x^2*z^2 + 2*x*y^3*z + y*z^5, {x, y, z}];
  3. Max[Total /@ (Position[coefs, x_ /; x != 0] - 1)]
Copy the Code
...
目前(2019年),直接使用Exponent命令,只能获取一元多项式的最高次数。
\[ x^3y + x^2z^2 + 2xy^3z + yz^5 \]
所以将其他变量全部用x替换,则使用Exponent命令,便可获取多元多项式的最高次数。
...
  1. x^3*y + x^2*z^2 + 2*x*y^3*z + y*z^5 /. y | z -> x // Exponent[#, x] &
Copy the Code
...
kuing.cjhb.site/forum.php?mod=viewthread&tid=5506

手机版Mobile version|Leisure Math Forum

2025-4-20 21:31 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list