Professional Documents
Culture Documents
Ni dung
Tnh ton vi cc biu thc n gin S dng help Tnh ton vi Ma trn v Vc t th
Cc phm , tin hoc lui lnh, , thay i v tr trn dng lnh // bt u ni dung ch thch
// The words after `//' are comments // and explanations. Do not type them in.
x = 2+3 y = 4+5 result1 = x/y p = 2+3 ; // The semicolons supress q = 3+5 ; // unwanted output. ratio = p/q
4
Du ; khng hin th kt qu
ratio = (2+3)/(x+4)
Php cng (+), tr (-), nhn (*), chia (/) Php tnh sin (sin), cosin (cos), logarith c s t nhin (log)... Hng s %pi, %i...
cos( %pi/3 ) // These are familiar trig functions. sin( %pi/6 ) // Note Scilab always uses radians.
S phc
x = 2 + 3*%i , y = 1 - 1*%i z1 = x - y , z2 = x * y , z3 = x / y abs( x ), real( x ), imag( x ) atan( imag(x) , real(x) ) // The argument of a complex number sin(x) // Scilab quickly calculates the sin of a complex number.
7
S dng help
help sin // Information about sin. help + // Gives links to help on Scilab operator names help log // This is enough information about log // to show log means log to the base e .
S dng help
C2: S dng help qua menu C3: S dng help trn internet
http://www.scilab.org/product/man/
A = [ 1 2 -1; -2 -6 4 ; -1 -3 3 ] b = [ 1; -2; 1 ]
Cc php cng (+), tr (-), nhn (*), chia (/), tnh nh thc (det)...
v = [-4,-3,1], p = poly(v,'X','coeff') x = poly(0,'x') // Seed a Polynomial using variable 'x' p = x^2 - 3*x - 4 // Represents x^2 - 3 x -4
z = roots( p ) z(1)^ 2 -3*z(1) -4 // Two ways to evaluate the poly. horner(p,z(1)) // at the first root. derivat(p,'x') // Calculate the derivative of the polynomial
12
th
x = [.5 .7 .9 1.3 1.7 1.8 ]' y = [.1 .2 .75 1.5 2.1 2.4 ]' plot2d(x,y, style=-1) Ch thch: s dng help plot2d hiu thm v style
13
th
14
th
In th hoc lu th ra bo co
Bng cc chc nng tng ng trong menu File Hoc lu li cc dng to Graph di dng Text
15