%% 2-D Delaunay Triangulation
% Compute and plot the convex hull of a 2-D Delaunay triangulation.
% Create a Delaunay triangulation from a set of 2-D points.

rng default;
x = rand([10,1]);
y = rand([10,1]);
DT = delaunayTriangulation(x,y);

%
% Compute the convex hull.

C = convexHull(DT);

%
% Plot the triangulation and highlight the convex hull in red.

plot(DT.Points(:,1),DT.Points(:,2),'.','MarkerSize',10)
hold on
plot(DT.Points(C,1),DT.Points(C,2),'r') 

% Copyright 2015 The MathWorks, Inc.