clear
;
%%read
3D data
fileID
= fopen('C:\Users\23124\Desktop\坐标转换\cloud1.txt','r');
%txt文件读成三维元胞数组cell形式
A
= textscan(fileID
,'%d %d %d');
%X
,Y
,Z数据类型均为
1*1 cell
X
=A(:,1);
Y
=A(:,2);
Z
=A(:,3);
%将元胞数组转化为矩阵形式
x
=cell2mat(X
);
y
=cell2mat(Y
);
z
=cell2mat(Z
);
%%show
3D data
%plot3(67,65,153,'*')
plot3(x
,y
,z
,'.',67,65,153,'*'); %红色圆点
xlabel('x轴'),ylabel('y轴'),zlabel('z轴')
grid on
转载请注明原文地址: https://mac.8miu.com/read-492182.html