Transcript Slide 1

LESSON 2

BASIC ELEMENT OF SCILAB

Azalya Rahmatika Fathul Fithrah

JURUSAN MATEMATIKA FAKULTAS MATEMATIKA DAN ILMU PENGETAHUAN ALAM UNIVERSITAS SYIAH KUALA DARUSSALAM, BANDA ACEH April, 2013

• Type of variables in Scilab, that’s booleans, complex numbers, integers, and strings.

• In Scilab, everything is a matrix.

• To be more accurate, we should write: all real, complex, boolean, integer, string and polynomial variables are matrices.

+ * / \ ^ ** ‘ addition Subtraction multiplication right division left division power power (same as ^) transpose conjugate

• • • May be as long as the user want, but only the first 24 characters are taken into account in Scilab Case sensitive Any line which begins with two slashes “ ignored // ” is

• Trigonometry • Other Function

Boolean variables can store true and false value.

True is written by %t or %T False is written by %f or %F

• %i represents the mathematical imaginary number

i

satisfies

i

2   1 which • Elementary function for complex variables

• Scilab integer data types • Overview of integers – An

n

-bit signed integer takes its values from the range: [  2

n

 1 , 2

n

 1  1 ] – An

n-

bit unsigned integer takes its values from the range [ 0 , 2

n

 1 ]

• Whenever we make a computation and do not store the result into an output variable, the result is stored in the default ans variable.

Once it is defined, we can use this variable as any other Scilab variable.

• Strings can be stored in variables, provided that they are delimited by double quotes ( “ ). The concatenation operation is available from the “ + ” operator.

• When we create and manage variables, Scilab allows to change the type of a variable dynamically. This means that we can create a real value, and then puut a string variable in it.

• We emphasize that Scilab is not a typed language. We do not have to declare the type of variable before setting its content. Moreover, the type of a variable can change during the life of the variable.

Thank You for Your Attention!