各位大大好
小妹最近使用语法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新手
请问版上大大,这个情况该怎么办?