4.4. Roots of a Polynomial
The roots of a polynomial can be found using the MATLAB function:
roots(p)
or
r= roots(p)
where p is a row vector containing the coefficients of a polynomial. It returns a column vector r whose elements are the roots of the polynomial.
Example 4.2.
Find the roots of the polynomial s2 + 3s + 2 = 0 Solution: The given expression is represented by coefficients of its terms as follows: p= [1 3 2]; To find the roots of p, the following command is used: r = roots(p); The value of column vector r containing the roots is returned as r = -2 -1 i.e., r1 = −1 and r2 = −2 are the two roots of the polynomial represented by vector p. |
Example 4.3.
Find the roots of the polynomial s4 + 3s3 − 15s2 − 2s + 9 = 0 Solution: It ... |
Get MATLAB® and Its Applications in Engineering: [Based on MATLAB 7.5 (R2007b)] now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.