能帮忙看一下是哪里出问题了嘛
% Import an STL mesh, returning a PATCH-compatible face-vertex structure
%导入STL网格,返回面片兼容的面顶点结构
fv = stlread('多特征模仁模型.stl');
%% Render
% The model is rendered with a PATCH graphics object. We also add some dynamic
% lighting, and adjust the material properties to change the specular
% highlighting.
patch(fv,'FaceColor', [0.8 0.8 1], ...
'EdgeColor', 'none', ...
'FaceLighting', 'gouraud', ...%高落德一种明暗绘制法
'AmbientStrength', 0.15);
% Add a camera light, and tone down the specular highlighting
%添加一个相机灯光,并调低高光
camlight('headlight');
material('dull');
% Fix the axes scaling, and set a nice view angle
%固定轴缩放,并设置一个很好的视角
axis('image');
view([-135 35]);
hold on
D=importdata('54个待测点.txt');
x=D(:,1);y=D(:,2);z=D(:,3);
scatter3(x,y,z)
title('模型及其点云');
xlabel('X');
ylabel('Y');
zlabel('Z');
hold on
p1=D(1:end-1,:);p2=D(2:end,:)
arrow3d(p1,p2,15,'cylinder',[0.5,0.5]);axis equal;grid on;
你检查以下文件“54个待测点.txt”里面是不是有三列以上,没有的话就会出现错误