Question: Create a function using matlab to compute integral numerically using Simpson s 3 / 8 Rule, that complete the integration with either Simpson s 1

Create a function using matlab to compute integral numerically using Simpsons 3/8 Rule, that complete the integration with either Simpsons 1/3 Rule or Trapezoidal Rule (whichever may be possible):
function integral = mysimpsons38(x, f)
% Integrates numerically using Simpson's 3/8 Rule and completes the integration with
% either Simpsons 1/3 or Trapezoidal Rule as applicable.
% Input:
%=====
% x = vector of independent variable values
% f = vector of corresponding function values
% Output:
%=======
% integral = numerically computed integral value
Integrate the following using both MATLABs integral() and mysimpsons38() and discuss your comparison:
limits of integration from 2 to 1(x +1/x)^2 dx

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Civil Engineering Questions!