Page 1 of 1

Submission requirements: Please submit the pdf published from your Matlab code. You can include your m-function at the e

Posted: Thu May 05, 2022 7:33 pm
by answerhappygod
Submission Requirements Please Submit The Pdf Published From Your Matlab Code You Can Include Your M Function At The E 1
Submission Requirements Please Submit The Pdf Published From Your Matlab Code You Can Include Your M Function At The E 1 (58.77 KiB) Viewed 32 times
Submission requirements: Please submit the pdf published from your Matlab code. You can include your m-function at the end of your m-script and then publish your code into one pdf file. Problem (10 points) The composite midpoint rule RM(f; P) to approximate f f(x)dr with the parti- tion Ph is n Xi-1 RM (f; Ph) = hf -^ Σ / (²-1 + ²) 2 i=1 where h= (b-a)/n and x₁ = a +ih for i = 0, 1, 2,...,n (1) Write a Matlab m-function Midpoint Rule.m to implement the composite midpoint rule RM (f; Ph). The m-function must receive the function handle f for f(x), the real values a and b, and the number of subintervals n. It must return the real value RM as the final approximation. (2) Write an m-script TestMidpointRule.m to use your m-function to approx- imate the integral 4 S 1+z2 dx = 4 [arctan x] = π with n= 1000. Display your approximation and the error of your approximation.