Solving a polynomial function using the solve function is not working

3 ビュー (過去 30 日間)
Jonas Morgner
Jonas Morgner 2022 年 5 月 9 日
回答済み: Torsten 2022 年 5 月 9 日
v1 = [1 -2 -5 6]
I need to store the polynomial function in a new vector: x^3 -2x^2 - 5x + 6 = 0
Did I do it correctly?
Secondly I need to solve the polynomial using the solve function, I tried to do it but it is not working
syms x3 x2 x1
eqn = [x3 - 2*x2 - 5*x1 + 6 == 0]
solve(eqn)

回答 (2 件)

KSSV
KSSV 2022 年 5 月 9 日
Read about roots
p = [1 -2 -5 6] ;
r = roots(p)
r = 3×1
-2.0000 3.0000 1.0000

Torsten
Torsten 2022 年 5 月 9 日
eqn = x^3 - 2*x^2 - 5*x + 6 == 0;
solve(eqn,'MaxDegree',3)

カテゴリ

Help Center および File ExchangePolynomials についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by