Question: solve the matlab 2 4) a)(10) Correct the given simple script code for Simpson numerical integration of f(x) given below. Segments (0) must be changes
2 4) a)(10) Correct the given simple script code for Simpson numerical integration of f(x) given below. Segments (0) must be changes from 1 to 10. Store absolute errors for each loop in Error vector. b)(15) Re-generate the same code which determines the segment number (Iteration) while absolute error lower than 103 57 f(x) = sin(3x) dx Answer 4a Original Code Corrected Code for i=10 point = 2*pi; a = pi; b = 5*pi/2; h = (b-a)/(point); x = a:2*h:b; f = sin(3*x); I_sims= (h/3)*(f(1) +4* sum (f (2:2:point- 1)) +2* sum (f (3:2:point-2)) + f (point)); fe = sin(3*x); Q-integral (fe, a,b); Error=abs (Q-I_sims) end Answer 4b
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
