Question: create a matlab code for the following 3. Construct an algorithm in a function named simpsons7 that takes three inputs; the integrand, the lower bound

create a matlab code for the following

create a matlab code for the following 3. Construct an algorithm in

3. Construct an algorithm in a function named simpsons7 that takes three inputs; the integrand, the lower bound of the integration and the upper bound of the integration. The function should compute and output three different approximations of an integral using exactly seven segments. You may call simpson13 and simpson38 as sub-functions. Compute the integral below using each of the methods listed below: 3 x2 +4.5x0.75x3 dx -3 (a) Using a function that is the indefinite integral. For example, for f(x) = x2, the function is g (x) = () x3. Then the exact or true value of the integral can be computed as Itrue g(b) g(a) where a and b are the limits of integration. (b) A single application of the trapezoidal rule (c) A composite application of the trap with n=7 (d) A single application of the simpson's 1/3 rule (e) A single application of the simpson's 3/8 method, and (f) Three approximations using the composite simpson7 function you created (g) Create a table with the Method, Value, and MAPRE (magnitude of the absolute percent relative error). Include 4 digits to the right of the decimal point in all numbers. Create an anonymous function to calculate the MAPRE. The table should look like the one below. Method Value MAPRE 333.9583 Exact TrapSingle TrapComposite Simpsons 1/3 Simpsons 3/8 S13 S13 S38 xxxx.xxxx xxx.xxxx S38 S13 - S13 xxxx . XxxX xxx. xxxx S13 S38 S13 xxxx. XXXX xxx. xxxx

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!