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画图加标题
原文:https://www.cnblogs.com/qinghev/p/9983216.html