making movies with avifile and addframe produces black screen in half of the movie

2 ビュー (過去 30 日間)
Anna
Anna 2011 年 8 月 19 日
Hello there!
I would very much appreciate some help with a movie I am making from my simulation results. Generally, the code is like this:
clear all; clc;
aviobj=avifile('movie.avi','fps',5);
img = figure();
ax = axes('parent',img);
hold(ax,'all');
set(ax,'XLim',[0 300]);
set(ax,'YLim',[0 300]);
for i=1:288
pl = plot(i,i,'parent',ax);
aviobj = addframe(aviobj,getframe(img));
delete(pl);
end
aviobj = close(aviobj);
close all;
Obviously, the pictures in it are more complex but this is the principle.
This works well, except: When looking at the movie, the second half of the movie is just a black screen.
What could be the problem here?
Thank you very much for your help!
Anna

回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by