%% Determine Polygon Holes
% Create a polygon containing one solid region and one hole, and determine which region is a hole.

t = 0.05:0.5:2*pi;
x1 = cos(t);
y1 = sin(t);
x2 = 0.5*cos(t);
y2 = 0.5*sin(t);
polyin = polyshape({x1,x2},{y1,y2})
plot(polyin)
TF = ishole(polyin)

%
% To query one boundary at a time, use the boundary index as a second argument.

TF = ishole(polyin,2)

% Copyright 2012 The MathWorks, Inc.