% 创建一个3D点集
points = [1 2 3; 4 5 6; 7 8 9; 10 11 12; 13 14 15];
% 使用convhull函数计算凸包
hull = convhull(points);
% 输出凸包点的索引
disp('Convex Hull Indices:');
disp(hull);
% 绘制点集和凸包
figure;
scatter3(points(:,1), points(:,2), points(:,3), 'filled');
hold on;
scatter3(points(hull,1), points(hull,2), points(hull,3), 'r', 'filled');
title('3D Convex Hull');
grid on;
axis equal;