Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

MATLAB APPLIED NUMERICAL METHOD MatLab and use a different code from the solutio

ID: 3841080 • Letter: M

Question

MATLAB

APPLIED NUMERICAL METHOD

MatLab and use a different code from the solution textbook

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 I=SimpsonPoints(x,y), where the input arguments x and y are vectors with the values of x and the corresponding values of f(x), respectively. The output argument I is 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 3, then the integration over the first two intervals is done with Simpsons’s 1/3 method and the integration over the rest of the intervals is done with the composite Simpson’s 3/8 method

9.1)

9.5)

9.20 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 I Simpson Points (x, y), where the input arguments x and y are vectors with the val- ues ofx and the corresponding values of f(x), respectively. The output argument I is the value of the inte- gral. 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 3, then the integration over the first two intervals is done with Simpsons's 113 method and the integration over the rest of the intervals is done with the com- posite Simpson's 3/8 method. (a) Use Simpson Points to solve Problem 9.1 (b) Use Simpson Points to solve Problem 9.5

Explanation / Answer

main.m

============================================================