File: README

package info (click to toggle)
scilab 2.6-4
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 54,632 kB
  • ctags: 40,267
  • sloc: ansic: 267,851; fortran: 166,549; sh: 10,005; makefile: 4,119; tcl: 1,070; cpp: 233; csh: 143; asm: 135; perl: 130; java: 39
file content (50 lines) | stat: -rw-r--r-- 2,311 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
The purpose of this contribution is to emulate the Matlab mexfile
mechanism for people too lazy/busy to learn the Scilab dynamic
link interfacing mechanism...
Only the most useful functions have been emulated. 
Nothing is provided to read/write binary .mat files inside mexfiles.
Matlab .mat files saved in Matlab4 format can be read by mtlb_read.  
Any Matlab mexfunction which uses the emulated functions can be used. 
(However, for calling Scilab functions inside 
mexfiles "mexCallSCILAB" should be used instead of "mexCallMATLAB").

1- Take the source code of an existing mexfunction or write yours 
   using the Matlab syntax.
   Rename the mexfunction (such as mexfunction1 in the file 
   mexfunction1.c). This is necessary if you want to use several
   mex functions. In Matlab all mexfunctions are called "mexFunction".
   Here, any name can be used (but of course the calling sequence is
   the usual one (nlhs, plhs, ...) and should not be modified).

2- Edit the Makefile to give the name of your mexfile objects and (if any)
   functions used by the mexfiles (which are not in the .c mexfile). 
   The Makefile generates two files: "generic_gateway.c" (C code) and "startup.sce" (scilab script).

3. You can edit the scilab script "startup.sce" and add your stuff by filling 
   appropriate string vectors:

-the name of Scilab function ("myfunction") associated with the C mexfunction:
 one row in the vector scilab_functions.
-the names of all necessary object files (.o) as argument to G_make 
(Note that on Unix/Linux machines generic_gateway.o must appear).
 
scilab_functions=['myfunction'];
object_files=G_make(['generic_gateway.o','my-mexfunction.o'],'generic.dll');
addinter(object_files,'generic_gateway',scilab_functions);

4. Enter: "exec startup.sce" at the Scilab prompt.

5. Call your new function (e.g. [p,q,r]=myfunction(a,b))

The program generic_gateway can be used for interfacing at most 100
mexfunctions (such as my-mexfunction). Of course you can build new programs
similar to generic_gateway. It is recommended that you build one such
program by topic. For instance algebra_gateway.c, image_gateway.c, 
wavelet_gateway.c, etc...

Note that the Makefile given here generates both the generic_gateway.c
and startup.sce file for the example functions given here.

ENJOY
F.D.