next up previous
Next: Scilab to Fortran translator Up: Matlab to Scilab Translator Previous: Simple graphics

Translation of a toolbox

This part demonstrate the translation of a Matlab free toolbox which calculates a potential flow around 2D airfoils. Sources may be found here. This little toolbox is composed by 3 M-files. Suppose these files are stored in a directory named airfoil The translation may be done as follow. Translated function (.sci, .sce) , help files (.cat) are written in TMPDIR+'/airfoil' directory..

Two small modifications are necessary on thickpot.m; otherwise the translated function does not work properly. Modified file

-->unix_s('mkdir '+TMPDIR+'/airfoil')
-->translatepaths('airfoil',TMPDIR+'/airfoil') 
------------ translation of airfoil/naca4.m -----------
------------ translation of airfoil/thickpot.m -----------
------------ translation of airfoil/tp_example.m -----------
-->unix_w('ls '+TMPDIR+'/airfoil')  // list generated files
naca4.cat
naca4.sci
sci_naca4.sci
sci_thickpot.sci
sci_tp_example.sci
thickpot.cat
thickpot.sci
tp_example.cat
tp_example.sce

The execution of the tp_example demo may be then be donne as follow:

-->getf(TMPDIR+'/airfoil/naca4.sci')
-->getf(TMPDIR+'/airfoil/thickpot.sci')
-->exec(TMPDIR+'/airfoil/tp_example.sce')

And generates 3 figures. first figure is:

\fbox{\epsfig{file=foo0_106.eps,width=3.75in}}



Scilab group