Question: 2) Write your own MATLAB function that calculates the trapezoidal estimate of an integral over a set of data points (that could be equally

2) Write your own MATLAB function that calculates the trapezoidal estimate of

2) Write your own MATLAB function that calculates the trapezoidal estimate of an integral over a set of data points (that could be equally or unequally spaced). Your function should have two vector input arguments, x and y, such that y = f(x). The function should have a one scalar output argument, I, containing the estimate of the integral. Use your function to obtain a value of the integral for the following unequally spaced data. x 0 0.1 0.3 0.5 0.7 0.95 1.2 f(x) 1 0.9048 0.7408 0.6065 0.4966 0.3867 0.3012

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!