Problem to be programmed in MATLAB
Solve the following problem using the MATLAB environment. Do not use MATLAB’s built-in functions that execute the operations that are being asked in the problem.
Write a user-defined MATLAB function that evaluates the definite integral of a function f(x) by using the Riemann sum (see Eq. (2.27)). 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
. Compare the result with the exact value of the integral, 1.
(2.27)
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.