Hello, thanks for reading this,
I have a image that I'm outputting to a gif/avi video, and neither one seems to work.
When I use the code:
lseg = getframe(h);
set(gcf,'InvertHardCopy','off')
imwrite(lseg.cdata, outputFileName, 'WriteMode', 'append');
camorbit(1, 0, 'data', [0 0 1])
drawnow
and see my image stack, they're all the same image: the lseg frame never gets updated when I rotate with camorbit. Additionally, when I try to make a video with:
fps = 60; sec = 10;
vidObj = VideoWriter('newfile.avi');
vidObj.Quality = 100;
vidObj.FrameRate = fps;
open(vidObj);
for i=1:fps*sec
camorbit(0.9,-0.1);
writeVideo(vidObj,getframe(gcf));
end
close(vidObj);
I get a 10 second video of a static frame: again, getframe never gets updated to the frame rotated by camorbit.
When I view the image as its writing, I can see the figure rotating. Its just when MATLAB writes to file, the written file frames are not updated.
Any ideas?