当前位置: 首页 > 工具软件 > Plot Drawing > 使用案例 >

Aiming at the problem that plot3 function drawing in MATLAB only outputs points instead of line

司业
2023-12-01

项目场景:

  • 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-')%
    

 类似资料:

相关阅读

相关文章

相关问答