필터 지우기
필터 지우기

Select all points inside a polygon to create a new matrix

조회 수: 6 (최근 30일)
Martha
Martha 2014년 3월 31일
댓글: Martha 2014년 3월 31일
Hi, I have a point cloud matrix x,y and I want to create a new matrix with all the points that are inside a polygon to create a new matrix with all the points that are inside a polygon.
Thank you in advance, Martha

채택된 답변

Walter Roberson
Walter Roberson 2014년 3월 31일
Find the convex hull, and then you can use the vertices in poly2mask()
If you want the hull to be non-convex (e.g., to follow the points of a "star") then you have more difficulty in defining "inside".

추가 답변 (1개)

Star Strider
Star Strider 2014년 3월 31일
Would the inpolygon function do what you want?
  댓글 수: 1
Martha
Martha 2014년 3월 31일
I try the inpolygon, but it return to me a matrix of the same size, only specifying with 1 and 0 the points that are in or out. But I want a new matrix with only the elements that are inside the polygon

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Elementary Polygons에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by