Tasked with solving for x

回答(1 个)

syms x
RC = @() randi([-25 25]);
eqn = RC()*x^5 + RC()*x^3 + RC()*x^2 + RC() == 0
eqn = 
p = sym2poly(lhs(eqn) - rhs(eqn))
p = 1×6
8 0 -3 -2 0 22
roots(p)
ans =
-1.2536 + 0.0000i -0.4214 + 1.1258i -0.4214 - 1.1258i 1.0482 + 0.6476i 1.0482 - 0.6476i

类别

帮助中心File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by