Example:实现任意个数图像且携带任意标题(应用绿色循环实现多个图像同时显示)
close all;
for i=1:10
figure(i);
x = -pi:.1:pi;
y = sin(x);
plot(x,y);
set(gca,'XTick',-pi:pi/2:pi);
set(gca,'XTickLabel',{'-pi','-pi/2','0','pi/2','pi'});
xlabel('-/pi /leq /Theta /leq /pi'); %图像下方-1.22处加入x坐标轴名称
ylabel('sin(/Theta)'); %图像y坐标轴名称
a=[1,2,3,4,5,6,7,8,9,10];
% title('Plot of sin(/Theta)'); %图像上方加入字符串标题(string)
title(['order=',num2str(a(i))]); %图像上方加入变量标题(variable)
% title(['order=',num2str(a(1))],'position',[0 -1.28]); %图像下方中间加入变量标题(variable)
% title(['order=',num2str(a(2))],'position',[0 -1.22]); %图像下方中间与'xlabel'同位置加入变量标题(variable)
text(-pi/4,sin(-pi/4),'/leftarrow sin(-/pi/div4)',...
'HorizontalAlignment','left'); %图像注释(annotation)
end