フィルターのクリア

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 件のコメント
Martha
Martha 2014 年 3 月 31 日
Thank you Walter, Im going to try it now!

サインインしてコメントする。

その他の回答 (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 Center および File ExchangeElementary Polygons についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by