Write a function with which you can calculate numerically the integral of a given real function with two limits a and b using the trapezoid rule. Modify fnExample4 to do this.
Write a function with which you can calculate numerically the integral of a given real function with two limits a and b using the trapezoid rule. Modify fnExample4 to do this. Write a function with which you can calculate numerically the integral of a given real function with two limits a and b using Simpson’s rule and the trapezoid rule, where, on one hand, you rely on a comparison of the functions fnExample4.m and the solution from Problem 70 and, on the other, on the MATLAB functions quad and trapz. This function should have no return value, but all the results should be formatted with fprintf and displayed on the screen.