How to calculate area of space in Matalb

Dear members, I want to calculate area of space created by 4 lines as figure. Could you help me to do that ? Thank you

4 Kommentare

It rather depends how variable the 4 lines can be. In your case you just have the y origin and two vertical x limits so it is just an integration of your curve between those limits. If they were 4 arbitrary lines then it is a whole different matter.
doc cumtrapz
and similar functions should be about to do this easily enough for the specific case you show.
Tran Hoa
Tran Hoa am 10 Okt. 2018
I will try. Thank a lot
Image Analyst
Image Analyst am 10 Okt. 2018
Is line #1 the blue curve, or the black top of the axes box?
Tran Hoa
Tran Hoa am 11 Okt. 2018
Is the blue curve. Thank

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Image Analyst
Image Analyst am 11 Okt. 2018

0 Stimmen

Try stacking the numerical row vectors of the curves vertically using a semicolon then use min() to get the lower-most curve:
bottomCurve = min([curve1; curve2; curve3; curve4; curve5; curve6], 1);
Then sum from the left index to the right index, whatever they are.
areaUnderCurve = sum(bottomCurve(index1 : index2))

Weitere Antworten (0)

Kategorien

Mehr zu Mathematics finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by