项目场景:
-
Data processing stage mapping stage
问题描述
-
In the MATLAB environment plot3 plot output is only points rather than lines
-
figure for i6=1:step plot3(DiscretePoint_CP{i6,1}(1,1),DiscretePoint_CP{i6,1}(2,1),DiscretePoint_CP{i6,1}(3,1),'ro') hold on grid on end
原因分析:
- The plot3 function under the for loop is a dot - by - dot plot
解决方案:
- The drawing data is stored as an array, and the plot3 function is directly used for array drawing without using for loop
-
for i11=1:50 X_point(i11,1)=DiscretePoint_CP{i11,1}(1,:); Y_point(i11,1)=DiscretePoint_CP{i11,1}(2,:); Z_point(i11,1)=DiscretePoint_CP{i11,1}(3,:); end plot3(X_point(:,1),Y_point(:,1),Z_point(:,1),'r-')%