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?

 Accepted Answer

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

Categories

Tags

Asked:

on 21 Feb 2012

Edited:

on 19 Oct 2013

Community Treasure Hunt

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

Start Hunting!