Question: Create a function as below: function [I] = compss(f, a, b, n) that takes a function f an interval [a,b], and an even number n
Create a function as below:
function [I] = compss(f, a, b, n) that takes a function f an interval [a,b], and an even number n and returns I, an approximation to
using Composite Simpson's rule.
If the input is odd, use the error function, that already built in MATLAB, to report an error.
THe function f should be evaluated a total of n+1 times.
We are trying to apply Composite Simpson rule, and build a function with it.
Please help me write this in MATLAB. Explanation also helpful. I am new to this programming. Thanks so much!
f(x)dar
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
