Thread Subject: Export matlab animation to avi

Subject: Export matlab animation to avi

From: Peng Lei

Date: 23 Oct, 2008 16:30:05

Message: 1 of 7

I created a Matlab GUI animation but how can I export the whole process into avi format from matlab?
Thanks

Subject: Export matlab animation to avi

From: Walter Roberson

Date: 23 Oct, 2008 17:08:31

Message: 2 of 7

Peng Lei wrote:
> I created a Matlab GUI animation but how can I export the whole process into avi format from matlab?

movie2avi(), or avifile() and addframe()

Subject: Export matlab animation to avi

From: Peng Lei

Date: 23 Oct, 2008 20:58:02

Message: 3 of 7

Thanks for the information, but I'm still confused about how to export the animation, ok, for example, from matlab help document I got the codes like this,
Z = peaks; surf(Z);
axis tight
set(gca,'nextplot','replacechildren');
% Record the movie
for j = 1:20
    surf(sin(2*pi*j/20)*Z,Z)
    F(j) = getframe;
end
% Play the movie twenty times
movie(F,20)
these codes make little animation run on a figure, but the point is how could it be export as avi file so that can be played by windows media player?

Subject: Export matlab animation to avi

From: Bruno Luong

Date: 23 Oct, 2008 21:21:01

Message: 4 of 7

"Peng Lei" <penglei@uwm.edu> wrote in message <gdqogq$mri$1@fred.mathworks.com>...
but the point is how could it be export as avi file so that can be played by windows media player?

movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, movie2avi, ...

Bruno

Subject: Export matlab animation to avi

From: Peng Lei

Date: 24 Oct, 2008 22:14:01

Message: 5 of 7

Ok, I got your point, it can really export the animation to an avi video. But my case is more complicated than that. first I creat a GUI interface with 4 panels and 2 axes, then I also made two pushbuttons on the GUI, click the first one, the background on panels and axes show up, click the second one, the progressing curve lines and moving images will show on the panels and axes. The matlab files contain one .M file and one .f file. Is it possible to record the process above to make it a avi file by matlab? If so, how?

Thanks

Subject: Export matlab animation to avi

From: NZTideMan

Date: 25 Oct, 2008 19:36:46

Message: 6 of 7

On Oct 25, 11:14 am, "Peng Lei" <peng...@uwm.edu> wrote:
> Ok, I got your point, it can really export the animation to an avi video. But my case is more complicated than that. first I creat a GUI interface with 4 panels and 2 axes, then I also made two pushbuttons on the GUI, click the first one, the background on panels and axes show up, click the second one, the progressing curve lines and moving images will show on the panels and axes. The matlab files contain one .M file and one .f file. Is it possible to record the process above to make it a avi file by matlab? If so, how?
>
> Thanks

Copy each panel, axis, figure, or whatever into a matrix using
getframe.
When you play the matrix back, you get a movie.
I think you're looking for a complicated solution, when it's really
quite simple.
You need to clearly think what you want to show in the movie, then
apply getframe appropriately.

Subject: Export matlab animation to avi

From: Walter Roberson

Date: 27 Oct, 2008 15:17:21

Message: 7 of 7

Peng Lei wrote:
> Ok, I got your point, it can really export the animation to an avi video. But my case is
> more complicated than that. first I creat a GUI interface with 4 panels and 2 axes, then
> I also made two pushbuttons on the GUI, click the first one, the background on panels
> and axes show up, click the second one, the progressing curve lines and moving images
> will show on the panels and axes. The matlab files contain one .M file and one .f file.
> Is it possible to record the process above to make it a avi file by matlab? If so, how?

When you say "record the process above", do you mean as in the movie would show the
pointer moving over and show the click on the first button, show the appearance
of the panels and axes, show the cursor moving over and clicking on the second button,
and so on? A sort of video record of "here is how to do this procedure" ?

If so, then you would need a second instance of matlab running, and that second
instance would have to be using getframe() and taking advantage of the fact that
when you use getframe() then in -some- configurations what is captured can be
whatever happens to be in that part of the screen at the time (e.g., if a
screen-saver had fired up, it might capture the screen-saver instead of the
matlab image.) This is, naturally, not very reliable -- the more so because the
two copies of matlab are going to be competing for the CPU.

If you want to make a movie of the -use- of a matlab program, I would recommend
that you do not create the movie in matlab itself, that you instead find some
screen capturing software appropriate for your operating system.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
machine for model Andreas 8 Jul, 2010 07:07:08
rssFeed for this Thread

Contact us at files@mathworks.com