How can the hatched area be calculated?

1 view (last 30 days)
Jian Wang
Jian Wang on 10 Aug 2017
Commented: Jian Wang on 10 Aug 2017
1. the two curves have different x coordinates
2. when there are intersections, I want the sumation of separate areas

Answers (1)

KSSV
KSSV on 10 Aug 2017
Doc polyarea
  1 Comment
Jian Wang
Jian Wang on 10 Aug 2017
Thank you for your answer. But result is not what I want. Here is an example:
x = [0;0;2;2;1;1;0]; y = [0;1;1;2;2;0;0]; A = polyarea(x,y);
The calculated area is 0!

Sign in to comment.

Categories

Find more on Programming in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!