各位大大好
小妹最近使用語法getframe
希望可以產生不要覆蓋舊圖的動畫,
以下是小妹的code
change = 8 ;
image = zeros (5,5) ;
A = ones(200) ;
K = kron(A,image);
for change= 1:8 if change > 5 ;
K(change) = [ -1 ];
else K(change) = [ 1 ];
end
switch change
case 1
for x = 200:400
for y=200:400
K(1000*y+x)=[1];
end
end
case 2
for x = 600:800
for y=200:400
K(1000*y+x)=[1];
end
end
case 3
for x = 200:400
for y=600:800
K(1000*y+x)=[1];
end
end
case 4
for x = 600:800
for y=600:800
K(1000*y+x)=[1];
end
end
case 5
for x = 200:400
for y=200:400
K(1000*y+x)=[-1];
end
end
case 6
for x = 600:800
for y=200:400
K(1000*y+x)=[-1];
end
end
case 7
for x = 200:400
for y=600:800
K(1000*y+x)=[-1];
end
end
case 8
for x = 600:800
for y=600:800
K(1000*y+x)=[-1];
end
end
end
imagesc(K);
axis square
colormap gray;
colorbar1 = colorbar('YLim',[-1,1]);
caxis manual caxis ([-1 1])
getframe
end
已經有試過加上語法movie,但是仍會被舊圖覆蓋
小妹是matlab新手
請問版上大大,這個情況該怎麼辦?