muq08
11-18-2009, 01:20 PM
I have to write a code for this in matlab and not sure how to....any help would be good:
Write a code which implements both the midpoint rule and Simpson's rule (with weights 1 4 2 4 ... 2 4 1) for evaluating integrals.
Plot the log of the error as a function of the log of h (the step size) when approximating I = integral[pi ->0] sin(x) and I2 = integral [2 -> 0] x
Write a code which implements both the midpoint rule and Simpson's rule (with weights 1 4 2 4 ... 2 4 1) for evaluating integrals.
Plot the log of the error as a function of the log of h (the step size) when approximating I = integral[pi ->0] sin(x) and I2 = integral [2 -> 0] x