Computer Science, asked by darkkhnight1100, 2 months ago

Write a MATLAB program to find the solution of the given equation using the Simpson 1/3rd and Simpson 3/8th rule:

Take the step size/spacing to be h=1

Answers

Answered by nikhilrajgone2008
3

Answer:

x1 = linspace(0,2,4);

x2 = linspace(0,2,7);

x4 = linspace(0,2,13);

y = @(x) 2+cos(2*sqrt(x));

format long

y1 = y(x1); res1 = simpson(x1,y1,[],'3/8'); disp(res1)

y2 = y(x2); res2 = simpson(x2,y2,[],'3/8'); disp(res2)

y4 = y(x4); res4 = simpson(x4,y4,[],'3/8'); disp(res4)

Explanation:

please give thank and please mark as brilliant

Similar questions