Numerically solve for x in a polynomial equation

If I have a 3rd order polynomial (y = ax^3 + bx^2 + cx + d) with all the coefficients known, how do I plug in a y number and get out the x number?

 採用された回答

Honglei Chen
Honglei Chen 2012 年 2 月 21 日

1 投票

Write the polynomial as
a*x^3+b*x^2+c*x+d-y
Then you can use fzero to solve x.
doc fzero

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2012 年 2 月 21 日

1 投票

roots( [a, b, c, d-y] )

1 件のコメント

Brian Haab
Brian Haab 2012 年 2 月 21 日
Thanks also for this answer.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangePolynomials についてさらに検索

タグ

質問済み:

2012 年 2 月 21 日

編集済み:

2013 年 10 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by