This question is closed. Reopen it to edit or answer.
can anyone explain this result ?
1 view (last 30 days)
i have a polynomial p = [ 3 -5 2 ]
i have calculated his roots r = roots(p) r= 1.0000 0.6667
then i wanted to obtain the expression of my polynomial i get:
expression= 1.0000 -1.6667 0.6667
which is not my first polynomial, can anyone explain to me?
Cam Salzberger on 23 Oct 2017
According to the poly function's documenation, poly and roots are inverses, but allowing for roundoff error, ordering, and scaling. If you notice in your code, expression == p/3, which is just p scaled by its first element. It's still solves the same equation:
3*x^2 - 5*x + 2 = 0
x^2 - (5/3)*x + 2/3 = 0