Question: Write a user-defined MATLAB function for integration with the composite Simpson's method of a function f(x) that is given in a set of n discrete


Write a user-defined MATLAB function for integration with the composite Simpson's method of a function f(x) that is given in a set of n discrete points that are spaced equally. For the function name and arguments use ESimpsonPoints(x,y, where the input arguments x and y are vectors with the values of x and the corresponding values of fox), respectively. The output argument Iis the value of the integral. If the number of intervals in the data points is divisible by 3, the integration is done with the composite Simpson's 3/8 method. If the number of intervals in the data points is one more than a number divisible by 3, the integration in the first interval is done with the trapezoidal method and the integration over the rest of the intervals is done with the composite Simpson's 3/8 method. If the number of intervals in the data points is two more than a number divisible by the integration over the first two intervals done Simpsons's 1/3 method and the integration over the rest of the intervals is done with the composite Simpson's 3/8 method. Use SimpsonPoints to solve Problem 2. Write a user-defined MATLAB function for integration with the composite Simpson's method of a function f(x) that is given in a set of n discrete points that are spaced equally. For the function name and arguments use ESimpsonPoints(x,y, where the input arguments x and y are vectors with the values of x and the corresponding values of fox), respectively. The output argument Iis the value of the integral. If the number of intervals in the data points is divisible by 3, the integration is done with the composite Simpson's 3/8 method. If the number of intervals in the data points is one more than a number divisible by 3, the integration in the first interval is done with the trapezoidal method and the integration over the rest of the intervals is done with the composite Simpson's 3/8 method. If the number of intervals in the data points is two more than a number divisible by the integration over the first two intervals done Simpsons's 1/3 method and the integration over the rest of the intervals is done with the composite Simpson's 3/8 method. Use SimpsonPoints to solve Problem 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
