MATLAB: Solving a cubic equation

cubic equationSymbolic Math Toolbox

I am using the command
x = solve('a*x^3 + b*x^2 + c*x + d')
to get the polynomial's roots. It returns a symbolic answer. Then i evaluate the a,b,c,d and i do copy-paste the first symbolic answer and then "enter" to get a numerical answer.
The numbers i get (1 almost real and 2 complex, as it is expected) are not roots of the equation!
I am looking for the poles of a mechanical system, so the roots must exist… What am i doing wrong?

Best Answer

Maybe I’m missing something, but why use the Symbolic Math Toolbox at all for this?
Use the roots function instead:
x = roots([a b c d])