我必须完全按照我的标题所说的去做。我有一个带有子图的图形,例如 3×5。我想在子图中获取所有不同的图形,并将它们中的每一个都设为一个框架(在本例中为 15 个不同的框架)。我尝试了不同的解决方案,但没有任何效果。例如我试过:
writerObj = VideoWriter('try.avi');
writerObj.FrameRate = 1;
open(writerObj);
h= figure(1);
for x=1:15
hh=subplot(3,5, x);
frame=getframe(hh);
writeVideo(writerObj,frame);
end
close(writerObj);
或者我试过
writerObj = VideoWriter('try.avi');
writerObj.FrameRate = 1;
open(writerObj);
h= figure(1);
fig=gcf;
axesHandles = get(gcf,'children');
for x=1:15
hh=subplot(3,5, x);
frame=getframe(axesHandles(x));
writeVideo(writerObj,frame);
end
close(writerObj);