Question: 8. Write a MATLAB function that will take as inputs a set of data (x,y) and output the best estimate of the integral using a
8. Write a MATLAB function that will take as inputs a set of data (x,y) and output the best estimate of the integral using a Romberg Array. The function should perform two trapezoidal integrations using the full interval and half the interval, and then combine these integrations in a Romberg Array. Your function should also output the relative error of the integral. Please note that the data entered may not be evenly spaced and your function should make sure that at least 3 data points were entered and that the x- and yvectors containing the data are the same length. Hint: Use interpolation to obtain the required points for the trapezoidal integrations function [integral, err] = Romberg(x,y)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
