Question: Trapezoidal rule Create a MATLAB function [ DLV ] integrateTrap ( ) , which takes and integrates an input function using the trapezoidal rule. The
Trapezoidal rule
Create a MATLAB function DLVintegrateTrap which takes and integrates an input function using the trapezoidal rule.
The input arguments are: a function, the step width h lower bound, and
upper bound of the integration interval, in that order total
The output of the function is the integral of the input function between the
lower bound and the upper bound.
Use this MATLAB function to numerically calculate the integral of the function fx ex across the interval with step widths h and Plot the following in GnuPlot DLV:
The input function ex across the interval;
The numerical integral values calculated in MATLAB in form of a bar
graph for each step width h together with the analytical integral value
also as a bar graph next to each numerical integral bar graph.
Make the plot look as clean as you can: give it a legend and ensure that the numerical integral bar graphs have a different color than the
analytical integral bar graphs.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
