Integration of polynomes can be hard with hand in calculus. In some engineering and scientific problems, very complex polynomials can be obtained to solve. In that way, you may need to calculate the integral of that polynomial. In Matlab®, you can calculate the integrations of polynomials in a very basic way, with the ‘polyint()’ command. In this article, we will explain the use of the ‘polyint()’ command to calculate integrations of polynomials in Matlab®, with a very basic example.
YOU CAN LEARN MatLab® IN MECHANICAL BASE; Click And Start To Learn MatLab®!
>> a = [2 5 3 6]; b = polyint(a) c = polyint(b, 5) b = 0.5000 1.6667 1.5000 6.0000 0 c = Columns 1 through 5 0.1000 0.4167 0.5000 3.0000 0 Column 6 5.0000 >>
First of all, you need to know how to define polynomials in Matlab®. To define polynomials, you need to create a vector that represents the polynomial in Matlab®. This representation is like that; For example, we created a vector a’ which represents the polynomial of 2x^3+5x^2+3x+6. As you understand that the coefficient degrees of constitutes constitute vector ‘a’. So you can create a vector that represents your polynomial like this.
To calculate the integration of a polynomial, you need to use the ‘polyint()’ command. You just need to type your vector that represents your polynomial, just like the above example. Polynomial ‘a’ is typed inside the polyint() command and it is assigned to variable ‘b’.
The result of integration is shown the same logic of representation of polynomials in Matlab®. ‘0’ at the end of result ‘b’ represents the integration constant.
If you want to use your integration constant, you can use the polyint() command as shown above. You need to type out the constant that you want to see, just beside the vector to be integrated, inside polyint() command in Matlab®.
As you see also, we calculated the second integration of ‘a’, which assigned to variable ‘c’ above as shown by the green arrow.
Integration in Matlab® with the ‘polyint()’ command is very simple like above. Do not forget to leave your comments and questions about the ‘polyint()’ command in Matlab® below. Your feedback is very important for us.
This article is prepared for completely educative and informative purposes. Images used courtesy of Matlab®
Your precious feedbacks are very important to us.