Beruflich Dokumente
Kultur Dokumente
Andam
EE 179.1 Section: H456
4:00
1 Objectives
2 List of equipment/software
Personal Computer
Installation of SCILAB
3.1 Variable
In Scilab, you can easily create and instantiate variables anytime. Unlike the C
language, Scilabs variables are dynamic and dont have to be created before they
are stored with values.
Open you Scilab now and try the following in the console.
--> clear
--> a = 1
The console should respond with the value of a. Now, after the above command, try
doing the following:
--> b = a
The console should respond with the value of b which is just the value of a in the
previous command.
1. How about this one?
--> b = aaa
What will be the response of the console?
Since aaa has not been assigned a value yet, it still does not exist.
Another convenient feature of Scilab is that you can assign any datatype to a
variable even after you had previously assigned a different datatype. For example:
--> b = 1
--> b = Hi, this is a string
--> b = [this,is, a, vector/array]
These commands will not produce an error. The datatype of the variables in Scilab
adapt to whatever value you store in it.
You may have noticed that the last command is an array. Arrays in Scilab are values
enclosed in [ and ] with values separated by spaces or commas. You can also
create a matrix by separating rows with a semicolon.
--> an_array = [1, 3, 4]
--> a_matrix = [1, 2; 4, 5]
2. What will you enter in the command line if you want to assign a_matrix
with
[ ]
1 2 3
4 5 6
7 8 9
3.2 Operators
Scilab has a lot of operators in addition to basic arithmetic operations. Since Scilab
operates on matrices by default, basic arithmetic operations are applied on
matrices.
Operat
or
+
*
/
\
^
Description
Matrix addition
Matrix subtraction
Matrix Multiplication
Matrix division.
A / B= AB1
Matrix back-division.
A = A1B
Matrix exponential.
Transpose
If you want element-wise operation using those operators, the operator is preceded
with a .
--> a = [1, 2; 3, 4]
--> b = [3, 4; 5, 6]
--> a + b
ans =
4.
6.
8.
10.
2.
3.
4.
6.
7.
10.
12.
4 Conclusion
Scilab is a very suitable mathematical software that can simulate
mathematical applications from simple to advanced engineering systems.
Variables and Arrays in Scilab are dynamic and are easily assigned different
values. Matrices in Scilab are flexible and can easily be manipulated. It is also
possible to plot curves in this program. Simulations can be run through a set
of commands in the command line, through a script written in the SciNotes. In
the Scinotes editor, one can create various functions according to the given
conditions of the user and be able to incorporate and execute that function to
the Scilab.
All in all, Scilab is a very helpful program especially in engineering. It is very
complex in its own, it can handle complicated equations and systems and
even perform graph plotting, yet it can easily be learned due to its user
friendly.