1. 程式人生 > >Matlab for循環subplot畫圖加標題

Matlab for循環subplot畫圖加標題

分享 圖片 \n sub 技術 bubuko int print alt

 x=1:10;
 for i = 1:4
     y=i*x;
     subplot(2,2,i)
     plot(x,y)
     title(sprintf(‘y=%i x\n‘,i))
 end

  效果如圖

技術分享圖片

Matlab for循環subplot畫圖加標題