Vous êtes sur la page 1sur 2

=>Basic operation<=

+ addition
- subraction
* multiplication
/ right division, i.e. x/y=xy^(-1)
\ left division, i.e. x\y=x^(-1)y
^ power
** power (same as ^)
' Transpose conjugate

=>Basic comands<=

clear- clear variables


clc- clear console (the workplace)
.. - continuation of line\
; - for the command not to be echoed in the screen

--> console

=>Trigonometric, logarithmic and other function (always in radians)<=

note: if there is d, i.e. sind(45) it means sin of 45 degrees


: %pi for the value of pi
: use help to know the function i.e --->help asinm

=>VAriables<=

%e- number e
%i - imaginary
%T or %F- true or false

note: any other number is true except 0

=>Logical and relational operators<=

a&b Logical and


a|b logical or
~a logial not
a==b true if the two expressions are equal
a~=b or a<>b true if the two expressions are different
a<b true if a is lower than b
a>b true if a is greater than b
a<=b true if a is lower or equal to b
a>=b true if a greater or equal to b

imult(x)= X*%i
real(p)= real part
imag(p)= imaginary part
isreal(p)= to see whether the function is pure real

**MATRIX**

eye identity matrix-->eye(3,3)


linspace linearly spaced vector-->linspace(1,12,4)

Ones and Zeros matrix consisting of all ones(or zeros)


random number between 0 and +1 inclusive--> rand()

A(1:4,1:3) --> to get minor inside of matrix, 1:4 is the row and 1:3
is the column

A(:,6)=[] --> to wipe out column 6 from Matrix A


A(:,6)=100--> change all the values from column 6 to 100
size(B) size of matrix B
size(B,1) size of row of matrix B
size(B,2) size of column of matrix B

Appended matrix A should be done by


--> A(2,3)= 3 then if matrix A is 3 by 3, row 2 column 3 will changed value to 3
-->A(7,2)=4 then MAtrix A wll be 7x3 now instead of 3x3 and the value ro
row 2 column 2 will be 4

A(4,:) meaning that we get all the values of the row 4 inside Matrix A
A(:,6) meaning that we get all the values from column 6
A(:,7)=A(:,6) this is applicable changing values of column 7 to values in column 6
or if the matrix only have 6 columns and wanted to add another column
which
is column 7.

b=[6; 12; 18; 30]--> this command creates values from one column

user defined functions, not in scilab but significant


- gagawa ka sa sarili mong function
global function kilala sya sa buong scilab
local function local lang sya

matrix A=round(20*rand(4,4))-10 -> to create matrix 4 x 4 randomly

Vous aimerez peut-être aussi