%% Polygon Boundary Vertices
% Create a polygon containing two boundaries, and display the vertex coordinates of both boundaries. The list of vertices for the boundaries are delimited by NaN.

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

% Copyright 2012 The MathWorks, Inc.