www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/BoundaryOf3DPointCloudExample.m

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

% Copyright 2015 The MathWorks, Inc.

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)