qinghev
x = 1:10;
h = zeros(4);
for i = 1:4
    y = i*x;
    h(i) = plot(x,y);
    hold on
end
legend(h([1,2,3,4]),\'y1\',\'y2\',\'y3\',\'y4\')
hold off

 

 在 for 循环中根据循环改变 legend,效果图如下

分类:

技术点:

相关文章:

  • 2021-08-21
  • 2021-10-03
  • 2021-11-04
  • 2021-10-04
  • 2021-12-18
  • 2021-12-26
  • 2021-12-29
猜你喜欢
  • 2021-08-07
  • 2021-12-02
  • 2021-11-28
  • 2021-09-09
  • 2021-09-25
  • 2021-12-04
相关资源
相似解决方案