Question: Create a function as below: function [I, n] = adaptive (f, a, b, tol) that takes a function f, an interval [a, b], and a
Create a function as below:
function [I, n] = adaptive (f, a, b, tol) that takes a function f, an interval [a, b], and a tolerance
= tol, and returns two values.
THe first return value is I, an approximation to
using adaptive Simpson's rule with tolerance
.
THe second return value is n, which is the number of points at which f must be evaluated to obtain the end result.
Please write this in MATLAB. I am just new to it. Explaination will also helpful. THanks so much!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
