Question: 2.25 Write a user-defined MATLAB function that evaluates the definite integral of a function f(x) by using the Riemann sum (see Eq. (2.7)). For function

2.25 Write a user-defined MATLAB function that evaluates the definite integral of a function f(x) by using the Riemann sum (see Eq. (2.7)). For function name and arguments, use I=Riemannsum (Fun, a, b). Fun is a name for the function that calculates the value of f(x) for a given value of x. It is a dummy name for the function that is imported into Riemannsum. a and b are the limits of integration, and I is the value of the integral. The Riemann sum is calculated by dividing the integration interval [a,b] into ten subintervals. Use Riemannsum for evaluating the definite integral 01xexdx. Compare the result with the exact value of the integral, 1. - Use MATLAB "inline" function or function handle to construct a mathematical function. - The only MATLAB built-in function may be used is "length()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
