Tuesday, November 22, 2011

Generate movie using Matlab ver 5.3.1

Surface wave propagation simulation movie, the movement of the bullet, and so on can be created by using a variety of softwares and a variety of ways. One of them is as will be explained here.
We can make movie simulation using Matlab program. Here matlab version 5.3.1 is used (old version). For Matlab version 6.0 upwards toolbox function to make the movie we can download it directly from Matlab (http://www.mathworks.com/matlabcentral/fileexchange/309).


Before making the movie, surely we must have the matlab software version 5.3.1. It is should be already installed in our computer.

If the matlab is already installed, we can download the mpgwrite files or download the files from here. This file should be unzipped first. After unzip, folder "mpgwrite" should be put in the directory "C:MATLABR11\toolbox\matlab"

See the following image,


Figure 1. put the folder mpgwrite.

The next step, we add the path via the Path Browser to the address of the folder above so that the path of his being,

"C:MATLABR11\toolbox\matlab\mpgwrite"

"C:MATLABR11\toolbox\matlab\mpgwrite\src"

as well as folders which we will use to run the program Matlab. See Figure 2 below,



Figure 2. Add the path to the folder "mpgwrite" and "mpgwrite\src"


After all we add, the next path we "save" so that when we close the matlab program, the path is still preserved. See Figure 3 below,



Figure 3. Save the path already created

For example, matlab script can be downloaded from here. Next we can run the program matlab 5.3.1 where already installed in the machine. The next step, we run the file as follows,

>> wav2d (' f ', f ',-1,1, jet, ' test. out ', ' test ', ' test. mpeg ', ' hyperbola ')

For details see Figure 4 below,


Figure 4. call a script function wav2d.

This Script will read the data file. "test out" and save the image into a series of images that are then saved into files movie that mpeg files "test.". See Figure 5 below,


Figure 5. The results shown after matlab script is executed.

Good luck.
For more information, if the script matlab still could produce the file path and the movie, you can contact ahmadzakaria@unila.ac.id.


No comments:

Post a Comment