Help to make a GIF of my animation

조회 수: 3 (최근 30일)
ferne17
ferne17 2013년 6월 15일
Hello, I have a presentation this week and I need to make a GIF of my animation, because It takes to many time to run the code in the middle of the presentation and I would prefer to show an animation and aboid any mistake.
My code is giant, aprox 1800 lines of code, so I don't want to bother you with that. I think the clue to make my GIF is in the for that create my animation and the last part of the code:
for h=1:100 . . . imagesc(cancha);pause(0.001); end
cancha is my matrix, with lenght aprox 40x40 and only integer numbers (-inf, inf)
if someone can help me that would be great. Greetings! PS: I'm trying to modelate an cellular automaton, so the code is huge because of the rules.
  댓글 수: 1
ferne17
ferne17 2013년 6월 15일
편집: ferne17 2013년 6월 15일
I solved this with an external program and the code result this:
for h=1:t .
.
.
G=imagesc(cancha);
pause(0.001);
hold on
Image = getframe;
P = frame2im(Image);
number = num2str(h);
extension = '.bmp';
filename = [number,extension];
imwrite(P,eval('filename'), 'bmp');
hold off
end (of the "for h")
With this you made "t" images "bmp", and after with this program: http://uwcem.ece.wisc.edu/downloadable/GaLE10.exe
Where you select the images bmp and press preview and you obtain a GIF. This probably wouldn´t be best way to do the GIF, but it's the only way I know. If someone knows another please tell me!

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Animation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by