Question
x = [1.3214; 1.8779; 2.1429; 2.2770; 2.4185; 3.5065; 4.7959; 5.3684; 5.9219; 6.6912; 6.9017; 7.1086; 8.1299; 8.2025; 8.3325; 8.6422; 9.1521; 9.2204; 9.2416; 9.4059; 9.6145; 9.6176; 9.6354;
x = [1.3214; 1.8779; 2.1429; 2.2770; 2.4185; 3.5065; 4.7959; 5.3684; 5.9219; 6.6912; 6.9017; 7.1086; 8.1299; 8.2025; 8.3325; 8.6422; 9.1521; 9.2204; 9.2416; 9.4059; 9.6145; 9.6176; 9.6354; 9.6840; 9.7353];
y = [2.3779; 2.3929; 2.4543; 2.6263; 2.6952; 2.6936; 2.6415; 2.6140; 2.5823; 2.5790; 2.5700; 2.5694; 2.5677; 2.5415; 2.5366; 2.5098; 2.5003; 2.4974; 2.4638; 2.4508; 2.4472; 2.4379; 2.3999; 2.3603; 2.1660];
Write a function with the header
function [left, mid, right] = myNumericInt(x, y)
which takes two vectors of data (of equal length) and returns the integral using a Left Reimann sum approximation, Middle Reimann sum approximation, and Right Reimann sum approximation. The Middle Reimann sum should be found by estimating y values midway between x-values. Do not assume x is equally spaced.
test
>>l,m,c] = myNumericInt(x,y)
l = 21.7187
m = 21.6771
c = 21.6355
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