-3

enter image description here This image has a number of closed polygons. What I need is the area between these polygons. So I figured that I could subtract area of each of these polygons from the whole.

The whole area would look something like the red outline but I do not know how to get it. So that is what i need.

If I can obtain the area between the polygons by any other method please do share those methods too.

Please try writing the entire code as this is my first time with any kind of coding! Thanks!

LinusGeffarth
  • 27,197
  • 29
  • 120
  • 174
  • "Please try writing the entire code" That's not quite how things work around here. You should make an effort yourself first as this is not a code writing service. You are more than welcome to *hire* someone to write it through another site though. – Suever Jul 04 '16 at 17:08
  • You also need to fully define your problem - in particular you have not expressed how the perimeter is to be determined, particularly as the perimeter you outline is not convex. (Obtaining a convex hull from a series of vertices is relatively simple, non-convex hulls are not so more info is needed). – Euan Smith Jul 04 '16 at 17:16

1 Answers1

0

If you are happy with a "user-defined" perimeter, use polybool from the Mapping Toolbox:

mathworks.com/help/map/ref/polybool.html

[xd, yd] = polybool('subtraction', x1, y1, x2, y2);