# Finding Roots Of Polynomials In Matlab(Illustrated Expression)

Polynomial calculations are very easy in Matlab. Also calculation of roots of a polynomial can be very tough in calculus. Sometimes you can have very long and complex polynomial to calculate its roots by hand. You can do this kind of stuff in Matlab with ‘roots()’ command very easily. In here, we explained the use of ‘roots()’ command in Matlab to find out roots of polynomials, with a very basic example.

### How To Use ‘roots()’ Command In Matlab? Use of ‘roots()’ command in Matlab to find the roots of polynomials.

First of all, you need to know how to define polynomials in Matlab. To define a polynomial, you need to create a vector that represents this polynomial in Matlab. For example, we created a vector called ‘a’ as shown in red box above, that represents the polynomial of 5x^4+6x^3+8x^2+4x+3. As you understand that each of coefficients are represented by a element in ‘a’ vector, from right to left. So, the logic behind definition of polynomials in Matlab is this.

Calculation of roots of a polynomial in Matlab is very easy actually. To calculate the roots of polynomials in Matlab, you need to use the ‘roots()’ command. As you see above example, we calculated the roots of polynomial ‘a’. What we did is just typing the ‘a’ inside the pharantesis of ‘roots()’ command as shown in red box above. As you see that the result has four roots. All the roots of this polynomial are complex numbers.

Finding or calculating roots of a polynomial with ‘roots()’ command in Matlab is very easy like above. Do not forget to leave your comments and questions about ‘roots()’ command in Matlab below. Your feedback is very important for us.