%% Query Points Inside Polygon
% Create a polygon containing two solid regions.

x1 = [0 1 2];
y1 = [0 1 0];
x2 = [2 3 4];
y2 = [1 2 1];
polyin = polyshape({x1,x2},{y1,y2});
plot(polyin)
hold on

%
% Define three points, and determine if they are in the polygon.

x = [1 2.5 3];
y = [0.25 0 1.5];
TFin = isinterior(polyin,x,y)
plot(x,y,'r*')

% Copyright 2012 The MathWorks, Inc.