Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.
SimpsonRule
Create another MATLAB function DLVintegrateSimpson just as in which takes the same input arguments. Create the same plot required in question DLV for the step widths h
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started