0

I have an array of points. Some of them are set to 1 (the red points in the picture), the rest are set to zero. How can I find all points inside the polygon created by my points (all green points in the picture)?

I don't want to just display them, I need their indexes.

enter image description here

My array of data is 3D.

user2738748
  • 1,106
  • 2
  • 19
  • 36
  • 2
    Have a look at MATLAB's convhull : http://fr.mathworks.com/help/matlab/ref/convhull.html - as well as MATLAB's inpolygon : http://fr.mathworks.com/help/matlab/ref/inpolygon.html – BillBokeey Oct 13 '15 at 13:22
  • Try something with the links i gave you and update your post with what you've tried if you still struggle, we'll be happy to help – BillBokeey Oct 13 '15 at 13:48
  • The red points are returned by the convhull function. The inpolygon function does exactly what I want, but in 2D and my real data is in 3D. – user2738748 Oct 13 '15 at 13:49
  • Well, this is a pretty different question then. There are quite a lot of discussion about it due to the fact that MATLAB doesn't have an inpolygon equivalent in 3D – BillBokeey Oct 13 '15 at 13:53
  • Apparently this can be done using delaunays triangulation and MATLAB's tsearchn function but i've never used that – BillBokeey Oct 13 '15 at 14:19
  • 2
    I suggest you edit the question / delete it and ask a new one. The question you're asking has a simple answer. You're looking for something completely different. – Stewie Griffin Oct 13 '15 at 14:29
  • What should I change in my question (apart from mentioning the dimention of my data)? – user2738748 Oct 13 '15 at 18:47

0 Answers0