%% Vertex Attachments of Delaunay Triangulation
% Create a 2-D triangulation using DelaunayTri.

x = rand(20,1);
y = rand(20,1);
dt = DelaunayTri(x,y);

%
% Find the triangles attached to vertex 5 and then plot them on top of the triangulation.

t = vertexAttachments(dt,5);
triplot(dt)
hold on
triplot(dt(t{:},:),x,y,'Color','r')
hold off

% Copyright 2020 The MathWorks, Inc.