Gui Code2 PDF
Gui Code2 PDF
An overview of Scilab’s introduction, how to install, how to use and small demo
program.
I. Introduction
SCILAB is a free scientific software for engineering and scientific applications.
It bases on a numerical, programming and graphics environment; similar in operation
but different syntax from MATLAB.
This is a self-contained package developed since 1990 by researchers from
INRIA and ENPC (France); it is now maintained and developed by Scilab Consortium
since its creation in May 2003.
Distributed freely and open source, Scilab is currently being used in
educational and industrial environments around the world.
Scilab includes hundreds of mathematical functions with the possibility to add
interactively programs from various languages (C, Fortran...). It has sophisticated data
structures (including lists, polynomials, rational functions, linear systems...), an
interpreter and a high level programming language.
Scilab can be run using a variety of OS like UNIX, Linux,
Windows(9X/2000/XP), etc.
2. Install Scilab
1
The simplest way to install and use Scilab is download scilab-4.0.exe, run and follow its
steps
2
¾ Graphic Window : select active graphic window
¾ New buttons can be added by the addmenu command.
z Sample Session for Beginners
3
Notes: The $ symbol stands for the last row or last column index of a matrix or vector.
The colon symbol stands for “all rows” or “all columns”.
z Function
4
z Boolean Matrices
Boolean constants are %t and %f. They can be used in boolean matrices. The syntax is
the same as for ordinary matrices i.e. they can be concatenated, transposed, etc...
Operations symbols used with boolean matrices or used to create boolean matrices are
== and ˜=
-->%t
%t =
T
-->[1,2]==[1,3]
ans =
TF
-->[1,2]==1
ans =
TF
-->a=1:5; a(a>2)
ans =
3. 4. 5.
-->A=[%t,%f,%t,%f,%f,%f];
-->B=[%t,%f,%t,%f,%t,%t]
B=
TFTFTT
-->A|B
ans =
5
TFTFTT
-->A&B
ans =
TFTFFF
z Integer matrices:
There are 6 integer data types defined in Scilab,
¾ 32 bit signed integers (int32)
¾ 32 bit unsigned integers (uint32)
¾ 16 bit signed integers (int16)
¾ 16 bit unsigned integers (uint16)
¾ 8 bit signed integers (int8)
¾ 8 bit unsigned integers (uint8)
e.g.
z Matrix Operations
6
z Exit from Scilab.
-->quit
z Programming: You can open Scipad to write your program
7
warning,
pause: temporarily suspends the operation of a function.
break: forces the end of a loop
return or resume : used to return to the calling environment and to pass
local variables from the function environment to the calling environment.
8
Palettes:
Sources
Sinks
Linear
9
Non-linear
Events
Threshold
10
Others
Branching
Electrical
11
ThermoHydraulics
Old Blocks
DemoBlocks
Notes
Scilab doesn’t have as many blocks as Matlab.
Scilab doesn’t have Visualize GUI as Matlab.
Scilab has many demos for us to self-study:
12
Although both types of file (`sce' files and `sci' files) contain code, they are different. `sce'
files are executed while `sci' files are loaded to be used when we need them.
13