0% found this document useful (0 votes)
177 views

Gui Code2 PDF

Scilab is a free scientific software for engineering and scientific applications similar to MATLAB but with different syntax. It can be installed on Windows, Linux, and UNIX systems. Scilab includes hundreds of mathematical functions and has data structures like lists, polynomials, and linear systems. Users can write scripts and functions using programming tools like loops and conditionals. The Scicos toolbox also provides block diagram modeling capabilities.

Uploaded by

majutakgentar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
177 views

Gui Code2 PDF

Scilab is a free scientific software for engineering and scientific applications similar to MATLAB but with different syntax. It can be installed on Windows, Linux, and UNIX systems. Scilab includes hundreds of mathematical functions and has data structures like lists, polynomials, and linear systems. Users can write scripts and functions using programming tools like loops and conditionals. The Scicos toolbox also provides block diagram modeling capabilities.

Uploaded by

majutakgentar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

SCILAB

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.

II. How to install


1. System Requirements
Scilab is distributed in source code format; binaries for Windows95/NT systems
and several popular Unix/Linux-XWindow systems are also available: Dec Alpha (OSF
V4), Dec Mips (ULTRIX 4.2), Sun Sparc stations (Sun OS), Sun Sparc stations (Sun
Solaris), HP9000 (HP-UX V10), SGI Mips Irix, PC Linux. All of these binaries versions
include tk/tcl interface.
The installation requirements are the following :
z for the source version: Scilab requires approximately 130Mb of disk
storage to unpack and install (all sources included). You need X Window
(X11R4, X11R5 or X11R6, C compiler and Fortran compiler (e.g. f2c or g77
or Visual C++ for Windows systems).
z for the binary version: the minimum for running Scilab (without sources)
is about 40 Mb when decompressed. These versions are partially statically
linked and in principle do not require a fortran compiler.

2. Install Scilab

1
The simplest way to install and use Scilab is download scilab-4.0.exe, run and follow its
steps

After finish installing:

II. How to use


z Editing a command line
¾ enter a command line by typing after the prompt, or
¾ using Scipad to edit
z The Scilab window has the following Control buttons.
¾ Stop interrupts execution of Scilab and enters in pause mode 
¾ Resume continues execution after a pause entered as a command in a function
or generated by the Stop button or Control C. 
¾ Abort aborts execution after one (or several) pause, and returns to top-level
prompt 
¾ Restart clears all variables and executes startup files 
¾ Quit quits Scilab 
¾ Kill kills Scilab shell script 
¾ Demos for interactive run of some demos 
¾ File Operations facility for loading functions or data into Scilab, or executing
script files. 
¾ Help : invokes on-line help with the tree of the man and the names of the
corresponding items. It is possible to type directly help <item> in the Scilab
window. 

2
¾ Graphic Window : select active graphic window
¾ New buttons can be added by the addmenu command.
z Sample Session for Beginners

Notes: Scilab is case-sensitive.


// is not interpreted (it is a comment line).
z Matrix:

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

We have the result:

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

¾ Programming Tools: Scilab supports a full list of programming tools


— loops, (for, while)
— conditionals, (==, <=, >=, <> or ˜=)
— case selection, and
— creation new functions.
¾ Special Function Commands: Scilab has several special commands which are
used almost exclusively in functions. These are:
— argn: returns the number of input and output arguments for the function 
— error: used to suspend the operation of a function, to print an error
message, and to return to the previous level of environment when an error
is detected. 

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.

z SCICOS: Scicos is a Scilab toolbox included in the Scilab Package. Written in


Fortran, C and Scilab language, it comes with complete source code. Scicos provides
many functionalities available in Simulink and SystemBuild.

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.

III. Useful Links


http://www.scilab.org/
http://scilabsoft.inria.fr/
http://www.scicos.org/
http://www.infoclearinghouse.com/Merchant2/merchant.mv?Screen=CTGY&Category_
Code=S

13

You might also like