%% Boundary of 3-D Point Cloud
% Create and plot a set of random 3-D points.

P = gallery('uniformdata',30,3,5);
plot3(P(:,1),P(:,2),P(:,3),'.','MarkerSize',10)
grid on

%
% Plot the boundary using the default shrink factor.

k = boundary(P);
hold on
trisurf(k,P(:,1),P(:,2),P(:,3),'Facecolor','red','FaceAlpha',0.1)

% Copyright 2015 The MathWorks, Inc.