The Command window

So far, you have been using the SCILAB command line, typing commands and expressions, and seeing the results printed in the command window. This section describes a few ways of altering the appearance of the command window. It is better to use fixed width font  such as fixedays or courier to provide proper spacing.

 

 

 

 

 

 

 

The format Command

The format command controls the numeric format of the values displayed by SCILAB. The command affects only how numbers are displayed, not how SCILAB computes or saves them. Here are the different formats, together with the resulting output produced from a vector s with components of different magnitudes.

    s = [ 10/3  1.234567e-6]

    format('v',10);s

        s =

        ! 3.3333333 .0000012 !

    format(20);s

        s =

        ! 3.3333333333333335 .00000123456700000 ! 

    format('e',10)s

        s =

        ! 3.333E+00 1.235E-06 !

 

 

Suppressing Output

If you simply type a statement and press Return or Enter, SCILAB automatically displays the results on screen. However, if you end the line with a semicolon, SCILAB performs the computation but does not display any output. This is particularly useful when you generate large matrices.

 For example,

        s = rand(1,100);

 

 

 

 

 

 

 

Long Command Lines

If a statement does not fit on one line, use three periods, ..., followed by Return or Enter to indicate that the statement continues on the next line. For example

 

s = 1 -1/2 + 1/3 -1/4 + 1/5 - 1/6 + 1/7 ...
      - 1/8 + 1/9 - 1/10 + 1/11 - 1/12;
Blank spaces around the =, +, and - signs are optional, but they improve readability

 

 

 

 

 

 

Command Line Editing

Various arrow and control keys on your keyboard allow you to recall, edit, and reuse commands you have typed earlier. For example, suppose you mistakenly enter
rho = (1 + sqt(5))/2
You have misspelled sqrt. SCILAB responds with
!--error     4
undefined variable : sqt 
Instead of retyping the entire line, simply press the key. The misspelled command is redisplayed. Use the key to move the cursor over and insert the missing r. Repeated use of the key recalls earlier lines. Typing a few characters and then the key finds a previous line that begins with those characters.

The list of available command line editing keys is different on different computers.

 


ctrl-p
Recall previous line

ctrl-n
Recall next line

ctrl-b
Move back one character

ctrl-f
Move forward one character
home
ctrl-a
Move to beginning of line
end
ctrl-e
Move to end of line
esc
ctrl-u
Clear line
del
ctrl-d
Delete character at cursor
backspace
ctrl-h
Delete character before cursor

ctrl-k
Delete to end of line