MATLAB Answers


Roots function is solving eigth order polynomial equation as fifth order.

Asked by Samridh Sharma on 14 Sep 2019
Latest activity Commented on by Samridh Sharma on 14 Sep 2019
I have an equation :
Using coeffs(), i get their coefficients, flip them left to right and then use roots() function to get its zeroes.
But, when , coeffs() function gives coeffs of non-zero terms only,
that is, for fliplr(coeffs(fn)) = [a,c,e,g,i]
So, when I put this coeffs() solution in roots(), it considers it as fifth order polynomial.
How can I get around this problem?





1 Answer

Answer by Steven Lord
on 14 Sep 2019
 Accepted Answer

Specify the 'All' option in your call to coeffs to return all the coefficients, even those that are 0.


Sign in to comment.