Environmental Engineering Reference
In-Depth Information
overwriting the red curve, before proceeding in the same manner with the next
concentration profile.
Note that there is another option connected with the ganim parameter. If the user
chooses ganim
1, the final blue colored profiles are not deleted. Thus the history of
the profile development remains visible in the following single plots of the
animation.
After the end of the loop, the entire animation is stored under the given file name.
Here we demonstrate the mpgwrite command, which does not belong to core
MATLAB ® . However, everyone is free to use the command; the corresponding
M-file can be downloaded from Mathworks web-site; see: http://www.mathworks.
com/matlabcentral/fileexchange . Don't forget to specify the directory path where
the corresponding files have to be saved (using the addpath command or the 'Set
Path
>
' sub-entry of the 'File' menu.)
The movie command starts the movie. The second formal parameter in that call
corresponds to the repetition time. If at that place a negative value is specified, each
animation is shown forward then backward. It is possible to influence the speed of
the animation by specification of a third formal parameter, which represents the
number of frames per second.
...
An example animation with ganim ¼ 2 is included in the accompanying
software under the name 'animation.mpg'.
The final frame is shown in Fig. 6.7 . As an exercise, the user may extend the
animation letting the profiles run through a cycle of colors.
1
t=1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Fig. 6.7 Final frame of example animation
 
Search WWH ::




Custom Search