Scilab is a free Scientific Software Package and can be found at http://www.scilab.org
It is used for numerical computations in engeneering, statistics and for plotting graphs and such.
It has connection to Tcl via these functions:
Scilab's help system is implemented using Tk.
GS (20120611) Here is a simple example for using Tcl-Tk with Scilab. There is no tclsh or wish in Scilab. Scilab evals commands with ScilabEval [L1 ] function.
There is 3 files (run.sce, distance.sci, gui.tcl).
The Scilab TCL_EvalFile function is used to display the GUI which calls a Scilab function to recompute the distance (function distance()) each time sliders are moved.
To make a test, put these 3 files in the same directory, run Scilab and change the working directory :
cd <your Scilab directory>
Enter the command:
exec ('run.sce')
and the GUI will display.
The file run.sce:
// run.sce exec distance.sci; TCL_EvalFile('gui.tcl');
the file distance.sci:
// distance.sci function dist = distance(x,y,z) dist = sqrt(x*x + y*y + z*z) endfunction
And the Tcl-Tk code:
# gui.tcl global x y z dist set x 10 set y 10 set z 10 set dist " " toplevel .w scale .w.scx -from 0 -to 200 -length 200 -resolution 1 -label "X" \ -orient horiz -bd 1 -showvalue true -variable x \ -command ComputeDistance scale .w.scy -from 0 -to 200 -length 200 -resolution 1 -label "Y" \ -orient horiz -bd 1 -showvalue true -variable y \ -command ComputeDistance scale .w.scz -from 0 -to 200 -length 200 -resolution 1 -label "Z" \ -orient horiz -bd 1 -showvalue true -variable z \ -command ComputeDistance label .w.lt -text Distance label .w.ldist -textvariable dist -bg lightblue eval pack [winfo children .w] proc ComputeDistance {w} { global x y z dist ScilabEval "dist = distance($x,$y,$z);TK_SetVar('dist',string(dist));" }