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 trapintf I where f is a n column vector of samples of a function f on an npoint equispaced grid over the interval I, and
So for example, if n and I ab then
where x a x xx x b are equallyspaced points along the interval ab
To get started, open a new script and set it up so that it is a function of the form s trapintf I Here, f will be a length n vector of values just like f above. The interval I will be a row vector containing the interval endpoints a and b
a Write down the trapezoidal rule with respect to the values fj fxj j 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
