computing area between 2 curves
이전 댓글 표시
I have two curves from the 2 vetctors as a result of simulation. I want to find the area between these 2 curves. The curves are intersecting many times.
any ideas are appreciated!!
채택된 답변
추가 답변 (1개)
Luffy
2012년 7월 3일
If u know the vectors then try using polyarea & subtract them
댓글 수: 3
Vijay
2012년 7월 3일
Luffy
2012년 7월 4일
I put too much thought into it,ws thinking about finding area covered by each curve with x axis and then subtracting them to get area between them.
Happy to know polyarea helped you
AC
2012년 7월 4일
Hi,
Substracting the two areas is ok if the curves don't cross and you substract in the right order (that is: highest - lowest). Otherwise you will end up with a wrong result. For example, take sin(x) and cos(x) between 0 and 2: int cos(t)-sin(t) dt = -0.5 approx. int abs(cos(t)-sin(t)) dt= 1.33 approx.
It's the second one that you want. So you should compute the area of the difference in absolute value (see my response below). Cheers,
AC
카테고리
도움말 센터 및 File Exchange에서 Detection에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!