next up previous contents index
Next: 6.6.1 Simple Scalar Example Up: 6. Interfacing C or Previous: 6.5 Maple to Scilab

6.6 Maple2scilab

  The procedure maple2scilab converts a Maple object, either a scalar function or a matrix into a Fortran subroutine and writes the associated Scilab function. The code of maple2scilab is in the directory SCIDIR/maple.

The calling sequence of maple2scilab is as follows:
maple2scilab(function-name,object,args)

When maple2scilab is invoked in Maple, two files are generated, one which contains the Fortran code and another which contains the associated Scilab function. Aside their existence, the user has not to know about their contents.

The Fortran routine which is generated has the following calling sequence:
<Scilab-name>(x1,x2,...,xn,matrix)
and this subroutine computes matrix(i,j) as a function of the arguments x1,x2,...,xn. Each argument can be a Maple scalar or array which should be in the argument list. The Fortran subroutine is put into a file named <Scilab-name>.f, the Scilab-function into a file named <Scilab-name>.sci. For numerical evaluation in Scilab the user has to compile the Fortran subroutine, to link it with Scilab (e.g. Menu-bar option 'link') and to load the associated function (Menu-bar option 'getf'). Information about link operation is given in Scilab's manual: Fortran routines can be incorporated into Scilab by dynamic link or through the Ex-fort.f file in the default directory. Of course, this two-step procedure can be automatized using a shell-script (or using unix in Scilab). Maple2scilab uses the ``Macrofort'' library which is in the share library of Maple.


 
next up previous contents index
Next: 6.6.1 Simple Scalar Example Up: 6. Interfacing C or Previous: 6.5 Maple to Scilab
Scilab Group