Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Develop a Matlab function mySimpson38 that calculates using the composite Simpson's 3/8 method for a set of discrete data points that are equally spaced. If
Develop a Matlab function mySimpson38 that calculates using the composite Simpson's 3/8 method for a set of discrete data points that are equally spaced. If the number of subintervals is not divisible by 3 because there is 1 extra subinterval, calculate the integral of the last 4 subintervals using Simpson's 1/3 method. If there are 2 extra subintervals, calculate the integral for the last 2 subintervals using Simpson's 1/3 method. If the number of subintervals is zero (= 1 data point only), the function shall return a value of zero for the integral. If the number of subintervals is one (= 2 data points only), the function shall use the trapezoidal method on the single interval. If the vectors x and y are not of equal length, the function shall execute Matlab's function error("...") with an appropriate error message. As input the function shall take the column vectors x and y that contain the data points. As output the function shall give the calculated integral I. You may call/use any function developed in recitation, homework, and/or exams
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started