小样z 2023-08-10 20:03 采纳率: 100%
浏览 10
已结题

matlab怎么作散点矩阵图?或者其他软件?

matlab怎么作散点矩阵图?
最好是这样的

img


或者r,lingo之类的都可以呀,当然最好还是matlab。

  • 写回答

1条回答 默认 最新

  • 配电网和matlab 2023-08-11 15:11
    关注

    matlab散点图可以用scatter函数,举例如下:

    x = linspace(0,3*pi,200);
    y = cos(x) + rand(1,200);  
    scatter(x,y)
    
    

    运行结果:

    img


    如果你想做成矩阵形式,可以使用subplot函数,例如:

    subplot(2,2,1)
    x = linspace(0,10);
    y1 = sin(x);
    plot(x,y1)
    title('Subplot 1: sin(x)')
    
    subplot(2,2,2)
    y2 = sin(2*x);
    plot(x,y2)
    title('Subplot 2: sin(2x)')
    
    subplot(2,2,3)
    y3 = sin(4*x);
    plot(x,y3)
    title('Subplot 3: sin(4x)')
    
    subplot(2,2,4)
    y4 = sin(8*x);
    plot(x,y4)
    title('Subplot 4: sin(8x)')
    
    

    运行结果:

    img


    把plot函数、subplot函数以及scatter函数相结合就可以实现你图片中这种效果。
    有用希望采纳一下哦

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 8月22日
  • 已采纳回答 8月14日
  • 创建了问题 8月10日