How to analyze multiple points inside a polygon with the inpolygon() function

3 views (last 30 days)
Hi community, I am trying to analyze a set of points inside a polygon and im not sure how to do it. This is the domain i want to analyze:
xcoords=-0.2:0.01:1.2;
ycoords=-0.7:0.1:0.7;
%call meshgrid to create 2D matrices for x,y mesh
mesh1=meshgrid(xcoords,ycoords); %We assign to the variables mesh1&2 the grids created by the function meshgrid taking as reference the discretize domain we chose (x,y)
mesh2=meshgrid(ycoords,xcoords)';
Inside this domain there is a polygon, say its a random polygon of 250 vertices(x,z). How can i use the function inpolygon to evaluate whether all the points in my domain are inside the polygon or not.
Thank you

Answers (0)

Community Treasure Hunt

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

Start Hunting!