Question: Trapezoidal challenge. In this problem we will create a function called trapint that has the following format: s = trapint ( f , I )

Trapezoidal challenge. In this problem we will create a function called trapint that has the following format: s = trapint(f, I), where f is a n 1 column vector of samples of a function f on an n-point equispaced grid over the interval I, and
. So, for example, if n =100 and I =[a,b], then
where x1= a < x2< x3<,x99< x100= b are equally-spaced points along the interval [a,b].
To get started, open a new script and set it up so that it is a function of the form s = trapint(f, I). Here, f will be a length n vector of values just like f above. The interval I will be a 2 row vector containing the interval endpoints a and b.
(a) Write down the trapezoidal rule with respect to the values fj = f(xj), j =1,2,,n. You should notice it requires a quantity called x. Using just the input to the function trapint, describe how to compute x.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!