![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/906450/image.png)
Why points inside a polygon can't be found completely by using "Inpolygon"
조회 수: 3 (최근 30일)
이전 댓글 표시
Dear all,
I would like to find a set of points (red points in the below figure) whether inside another bunch of points (blue points in the below figure). Thus, I use the "inpolygon" command, but stragely only some of points located inside the polygon are returned. Why it happens? how to fix it?
load data.mat
ind=inpolygon(source_xtheta,source_ytheta,xloc,yloc);
figure;
plot(xloc,yloc,'bo');
hold on;
plot(source_xtheta(ind),source_ytheta(ind),'r*');
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/906380/image.png)
Figure 1: Problem Definition
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/906385/image.png)
Figure 2: Matlab Result
댓글 수: 0
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!