1.4 Visualisation with SciLab
7
http://www.scilab.org
SciLab scripts are formulated as text documents with the file extension “.sce”.
SciLab is a windows-based application software. It has a main control window, a
script-based editor window, and a graphics display window. For more information
on the use of SciLab, the reader should study the tutorial found on the Springer
server. The author has used Version 5.1.1.
1.4.2 GIF Animations
A numbered sequence of GIF files is produced with addition of the following lines
at the end of a SciLab animation loop:
if n < 10 then
xs2gif(0,’Frame100’+string(n)+’.gif’)
else
if n < 100 then
xs2gif(0,’Frame10’+string(n)+’.gif’)
else
xs2gif(0,’Frame1’+string(n)+’.gif’)
end
end
In this example, “0” refers to the index of the graphics window, the index n is
the loop counter used in the animation loop. This produces the sequence of GIF
files: Frame1001.gif, Frame1002.gif, Frame1003.gif, etc. The open-source software
ImageMagick can be downloaded from:
http://www.imagemagick.org/
This software can be used to convert these GIF frame files into a single GIF animation, that can be viewed in many Internet browsers. Conversion into an animated GIF
file, called “Animation.gif”, for example, is achieved by entering in the Command
Prompt window:
convert -delay 10 Frame*.gif Animation.gif
where the delay option specifies the time lapse between frames in milliseconds.
After creation of an animated GIF file, the reader should delete individual frame
files to free up some space on the computer by entering:
del Frame*.gif
7
http://www.scilab.org
SciLab scripts are formulated as text documents with the file extension “.sce”.
SciLab is a windows-based application software. It has a main control window, a
script-based editor window, and a graphics display window. For more information
on the use of SciLab, the reader should study the tutorial found on the Springer
server. The author has used Version 5.1.1.
1.4.2 GIF Animations
A numbered sequence of GIF files is produced with addition of the following lines
at the end of a SciLab animation loop:
if n < 10 then
xs2gif(0,’Frame100’+string(n)+’.gif’)
else
if n < 100 then
xs2gif(0,’Frame10’+string(n)+’.gif’)
else
xs2gif(0,’Frame1’+string(n)+’.gif’)
end
end
In this example, “0” refers to the index of the graphics window, the index n is
the loop counter used in the animation loop. This produces the sequence of GIF
files: Frame1001.gif, Frame1002.gif, Frame1003.gif, etc. The open-source software
ImageMagick can be downloaded from:
http://www.imagemagick.org/
This software can be used to convert these GIF frame files into a single GIF animation, that can be viewed in many Internet browsers. Conversion into an animated GIF
file, called “Animation.gif”, for example, is achieved by entering in the Command
Prompt window:
convert -delay 10 Frame*.gif Animation.gif
where the delay option specifies the time lapse between frames in milliseconds.
After creation of an animated GIF file, the reader should delete individual frame
files to free up some space on the computer by entering:
del Frame*.gif
