for i=1:3
x=1:5;
B=rand(3,5);
figure
plot(x,B(i,:))% 批量繪圖
saveas(gca,num2str(i),'jpg');%批量存圖,注意圖號及圖片格式的表示方法
close;
end
保存的圖片如下:
圖1
圖2
圖3
for i=1:3
x=1:5;
B=rand(3,5);
figure
plot(x,B(i,:))% 批量繪圖
saveas(gca,num2str(i),'jpg');%批量存圖,注意圖號及圖片格式的表示方法
close;
end
保存的圖片如下:
圖1
圖2
圖3
a=[2 4 6 ; 7 9 3 ; 5 6 8; 3 5 9]; for i =1:length(a) if a(i,1)<4 a1(i,:)=a(i,:);%第一列的數字小於4,所在行