Getting Started Previous page   Next Page

Creating Movies

If you increase the number of points in the Brownian motion example to n = 300 and s = .02, the motion is no longer very fluid; it takes too much time to draw each time step. It becomes more effective to save a predetermined number of frames as bitmaps and to play them back as a movie.

First, decide on the number of frames:

Next, set up the first plot as before, except using the default EraseMode (normal):

Generate the movie and use getframe to capture each frame:

Finally, play the movie 30 times:


Previous page  Animations Programming Next page

© 1994-2005 The MathWorks, Inc.