Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write the MATLAB code please (40 Points) Construct an algorithm in a function named simpsons7 that takes three inputs, a function handle, the lower bound
Write the MATLAB code please
(40 Points) Construct an algorithm in a function named simpsons7 that takes three inputs, a function handle, the lower bound of the integration and the upper bound of the integration. The function should compute and output the three different approximations of an integral using exactly seven segments. You may cal simpson 13 and simpson38 as sub-functions (you must include this in the header). Compute the integral below using each of the methods listed below: 5 (0.075x50.6x4+0.2x2 +0.5) dx -5 (a) Create a table with the Method, Value, and MTPRE (magnitude of the true percent relative error) for each of the methods below. Include 4 digits to the right of the decimal point in all numbers. Create an anonymous function to calculate the MTPRE (Do NOT put a semicolon at the end). The table should look like the one below. Note that the "-" in the last three lines of the table is a dash (not a minus sign). (40 Points) Construct an algorithm in a function named simpsons7 that takes three inputs, a function handle, the lower bound of the integration and the upper bound of the integration. The function should compute and output the three different approximations of an integral using exactly seven segments. You may cal simpson 13 and simpson38 as sub-functions (you must include this in the header). Compute the integral below using each of the methods listed below: 5 (0.075x50.6x4+0.2x2 +0.5) dx -5 (a) Create a table with the Method, Value, and MTPRE (magnitude of the true percent relative error) for each of the methods below. Include 4 digits to the right of the decimal point in all numbers. Create an anonymous function to calculate the MTPRE (Do NOT put a semicolon at the end). The table should look like the one below. Note that the "-" in the last three lines of the table is a dash (not a minus sign)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started