フィルターのクリア

movie2avi - I am getting a blank movie, but no errors.

5 ビュー (過去 30 日間)
Matthew
Matthew 2013 年 2 月 18 日
When I make the movie, it plays fine while I'm running the code. When I run movie(M), it gives me a weird off-center axis and movie2avi(M,'somename.avi') is just a blank screen of the proper time.
Z = peaks;
surf(Z);
axis tight
hfig=figure;
xlabel('x');
ylabel('y');
zlabel('z');
xlim([0 60]);
ylim([0 60]);
zlim([-10 10]);
M(1)=getframe(hfig);
for k = 2:200
surf(cos(2*pi*k/50)*Z,Z)
zlim([-10 10]);
M(k) = getframe(hfig);
end
Any help would be great. Thanks

回答 (2 件)

Walter Roberson
Walter Roberson 2013 年 2 月 19 日
You might need to add a pause() for a short time before the getframe. You are not supposed to need that, but in practice some people need it.
Also, before the first getframe() you should
hold all
and change your graphics code slightly. Easiest for me to show you:
Z = peaks;
hfig=figure;
oldsurf = surf(Z);
axis tight
xlabel('x');
ylabel('y');
zlabel('z');
xlim([0 60]);
ylim([0 60]);
zlim([-10 10]);
hold all
pause(0.1)
M(1)=getframe(hfig);
for k = 2:200
delete(oldsurf);
oldsurf = surf(cos(2*pi*k/50)*Z,Z);
pause(0.1)
M(k) = getframe(hfig);
end
hold off

Matthew
Matthew 2013 年 2 月 21 日
Thanks for the help but it's still giving me weird results.
I ran the correction and it still isn't giving me a movie. When I run movie(M) the movie is the axis with whatever is on my desktop behind the figure.
  1 件のコメント
Image Analyst
Image Analyst 2013 年 2 月 21 日
All movies, or just one particular movie? Could you upload the movie somewhere?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAnimation についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by