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

rng('default');
P = rand([25,3]);
DT = delaunayTriangulation(P);

%
% Compute the convex hull and the volume bounded by the convex hull.

[C,v] = convexHull(DT);

%
% Display the volume and plot the convex hull.

v
trisurf(C,DT.Points(:,1),DT.Points(:,2),DT.Points(:,3), ...
       'FaceColor','cyan')

% Copyright 2015 The MathWorks, Inc.