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 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
Get step-by-step solutions from verified subject matter experts
