Matlab Code
1. Approximate the following integral exp(r), using the composite midpoint rule, composite trapezoid rule, and composite Simpson’s method. Each method should involve exactly tegrand evaluations,k1:20. On the same plot, graph the absolute error as a function of n 2. Approximate the integral from Question 1 using integral, Matlab’s built-in numerical integrator. What is the absolute error? 3. Repeat Question 1 for using integral for the “exact” solution. Optional/ungraded: Improve integrate’s approximation using its AbsTol and RelTol options. Also, exploit
OR
OR