Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

I cannot make 'getframe' to 'moive2avi'

조회 수: 1 (최근 30일)
OoM
OoM 2015년 2월 27일
마감: MATLAB Answer Bot 2021년 8월 20일
I have a code shown below
fig = figure('Color',[1 1 1]);
t = 140;
for degree = 1:10:360
clf
plot3(C{:},'marker','.','MarkerSize',16,'linestyle', 'none')
view(degree, 30+15*sin(degree/60));
drawnow
mov(degree) = getframe;
t = t+1;
end
Then it can show animation rotating my 3D graph. However, I cannot use movie2avi to export my animation to movie and save to folder.
movie2avi(mov, 'mymovie.avi', 'compression', 'None');
Please help. Thank you very much.
PS: I use MATLAB R2012a

답변 (1개)

Image Analyst
Image Analyst 2015년 2월 27일
What's C? What's the purpose of t? Did you know there is a sind() function that takes arguments in degrees instead of radians?
See my attached demo where I do this same thing (having graphs be movie frames, but it works).
  댓글 수: 3
OoM
OoM 2015년 2월 27일
I use writerVideo but i get an error
Error using VideoWriter/writeVideo (line 326) Frame must be 237 by 327
Anyway that I can change the frame size?
Image Analyst
Image Analyst 2015년 2월 27일
Do you have VideoWriter? I'm not sure when it was introduced. And you forgot to attach your m-file so you've given me nothing to try, except my own demo which I know works.

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by