Question
NUMERICAL INTEGRATION (35pts). Develop a function in Matlab that implements the iterative (recursive) trapezoidal rule technique covered in lecture, in which points are added in
NUMERICAL INTEGRATION (35pts). Develop a function in Matlab that implements the iterative (recursive) trapezoidal rule technique covered in lecture, in which points are added in between existing points to reach a desired level of accuracy. The function should take 4 arguments: a function handle that returns the mathematical function value at a desired point [func = @(x) ], the integration bounds (a,b), and the desired relative error (eps = 1e-4). It should return the (single) value of the definite integral. Use this code to integrate two functions. a. sin(x) over the interval (a, b) = (0, ?) b. cos(6 ? x) exp(-4 x) over the interval (a,b) = (0, 1 1/2).
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