Question: This is a MATLAB question. Create a function called intpoly() that can numerically integrate the polynomial function y = ax^2 + bx + c from

This is a MATLAB question.

This is a MATLAB question. Create a function called intpoly() that can

Create a function called intpoly() that can numerically integrate the polynomial function y = ax^2 + bx + c from a lower limit to an upper limit, where a, b, and c are constants. Your numerical integrator must allow the user to use the Trapezoidal method or Riemann sums method (as we used in discussion) depending on the choice of the user. If the value of choice is 1, the Riemann sums method will be used to numerically integrate the polynomial (you may use either a left, right, or midpoint Riemann sums method). If the value of choice is 2, the Trapezoidal method will be used to numerically integrate the polynomial. The main program calls the function intpoly() and has the following form: % numerically integrate y(x) = ax^2 + bx + c % from lowerlimit to upperlimit a = 2: b = 2: c = 1: % from 0 to 1 lowerlimit = 0: upperlimit = 1: % number of discretizations N = 1000: % choice: 1 = Riemann, 2 = Trapezoidal choice = 2: disp(intpoly{a, b, c, lowerlimit, upperlimit, N, choice)) The arguments passed down to intpoly() are the polynomial coefficients (a, b, c), the lower and upper limits of integration (lowerlimit, upperlimit), the number of discretizations (N), and the method of integration (choice). The area is returned to the main program. An on-tutorial and demonstrator for numerical integration can be found here

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!