Left Riemann numerical integration A curve is represented by column arrays xCoor
ID: 2080148 • Letter: L
Question
Left Riemann numerical integration A curve is represented by column arrays xCoordinate and yCoordinate. Approximate the integral from xCoordinate(1) to xCoordinate (end) using the Left Riemann approximation method. Assign sumArea with the approximate area under the curve Hint A row array fepresenting the area of each rectangle can be calculated by (dtference between each element in xCoordinate)." yCoordinate Ex te 11, 3, 51 and ycoordinate 2, 4. 71. then sumArea B-1Xa) (5.3x4) 4.8 12 Your Solution Save CReset MMATLAB Documentation 1 function sumArea Left RienannApprox(xCoordinate, y coordinate) 2 s xCoordinate: Row array of x coordinates 3 Coordinate: Row array of y coordinates 5 Row array of rectangle areas is (difference between each element in CoordinatExplanation / Answer
Matlab Code:
function sumArea = LeftRiemannApprox(xCoordinate,yCoordinate)
sumArea = 0;
for i=1:length(xCoordinate)-1
sumArea = sumArea+((xCoordinate(i+1)-xCoordinate(i))*yCoordinate(i));
end
end
output:
>> sumArea = LeftRiemannApprox([1 3 5],[2 4 7])
sumArea =
12
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.