Problem 1 of 2 Area under the curve. Area
In many engineering problems, finding the area under a curve is fundamental to the solution. In
calculus, integral preforms the mathematics to allow computation of the results. In some
applications, a numerical approach is the only available option.
If we consider a series of rectangles and sum the area of the rectangles, we can begin estimate
the area.
If we have a data set consisting of N data pairs: xn,yn there will be N-1 intervals between data
pairs.
In the above diagram, the lessor of the two edges has been selected for the y value of the
rectangle, and the width of the rectangle is xn-1 – xn
We can therefore write the estimated area as:
Write a MATLAB user defined function and save a file with name Area which will estimate the
area from a data set:
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
23 | 24 | 25 | 26 | 27 | 28 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 | 1 | 2 | 3 | 4 | 5 |
Get Free Quote!
285 Experts Online