Session 1: Scilab Environment


Objectives

A beginner is usually apprehensive when starting to learn a new software. The best way to get acquainted with a new software is to study its working environment and learn how to get help in learning the software. The best form help is online help that the software offers right there on the screen. Next, you must learn a few shortcuts that make working in the software easy and quick.

In this session you will learn the following:

  1. Visible components of Scilab, the Scilab console
  2. Invisible component of Scilab, the Scilab workspace
  3. Invoking online help
  4. Working in Scilab console
  5. Closing Scilab session

Visible Components of Scilab Environment

When you start Scilab, you see the Scilab console, with the command prompt waiting for you to type a valid Scilab command. In addition to the console, Scilab has other environments, namely:

  1. Editor (called SciNotes),
  2. Variable Browser and Editor,
  3. History Browser,
  4. Scilab Help,
  5. ATOMS (AuTOmatic Modules Management for Scilab) and
  6. Xcos.

Note:

  1. Variable Browser and Editor, History Browser and ATOMS were introduced in Scilab version 5 and are not available if you are using an older version of Scilab.
  2. Xcos is the revamped replacement for Scicos of the older versions of Scilab.


When you start Scilab, only the console is open and the other environments are not. Choose the environment you want to use from the Main Menu under Applications.

It is possible to dock all these environments into the console window by dragging the environment you wish to dock and dropping it into place in the console. However, a beginner will take some time to master this operation.

For more details about these environments, visit this link on the Scilab website.

Invisible Components of Scilab Environment

While the above are the visiblle components of Scilab environment, there is the invisible component of Scilab, the Scilab Workspace. Workspace is the memory space where Scilab stores its environment variables, constants, variables, compiled functions and libraries. The Variable Browser and Editor offers a view of the Workspace contents, it shows only the environment variables, constants and variables but not the functions and libraries. Further, it does not permit clearing variables from the Workspace. Thus, until it is improved, we will view and manipulate the Workspace using commands such as who, whos, clear, save, load etc.

Invoking Online Help in Scilab

Scilab provides online help in a browser like environment, and is similar to the online manual of *nix, namely, man. Help can be invoked in a number of ways:

  1. Use mouse to choose Main Menu -> ? -> Scilab Help
  2. Type F1 from the console
  3. Command help <cr> typed at the command prompt. This opens the Scilab Help browser where you can browse through the Table of Contents or use the Search feature.
  4. Command help pattern <cr> typed at the command prompt. This opens the Scilab Help browser and shows all commands or contents matching the patterns you entered.

Working with Scilab Console and Some Useful Console Shortcuts

Scilab console is similar to the terminal in *nix or MS DOS Prompt of Windows. It is a shell that interprets the command typed by the user, executes the command and displays the results.

  1. Scilab commands are case sensitive. the characters A and a are distinct.
  2. To let Scilab console know the command is complete, press the Enter key. Only then does the command get executed.
  3. If you type a command that Scilab does not understand, it will display an error message.
  4. Commands you type may be names of variables, names of Scilab functions or names of user defined functions currently loaded into Scilab Workspace (we will see how to do this when we discuss Scilab functions in a later session)

A beginner should quickly master the following things to become comfortable working in the Scilab console:

  1. To clear the screen type the clc <cr> at the command prompt or simply press the F2 key.
  2. To abort a command midway without executing it, press the Esc key on the keyboard.
  3. Scilab offers command completion, similar to the feature available in bash shell in *nix (Unix, Linux). Press the Tab key to use the command completion feature. You will be shown a list of commands matching the pattern already typed and you can scroll through the list and choose one of them or type more characters to reduce the list of matching commands.
  4. A history of previous commands is stored and you can scroll through this history by pressing the Up or Down arrow keys on your keyboard. Alternately, you can open the History Browser environment. You can edit any previous commands using Left Arrow, Right Arrow, Home and End keys to move about the command and Backspace and Del keys to delete characters and you can type in new characters. This feature is again similar to the one in bash shell.

Closing Scilab

You can close Scilab in one of the following ways:

  1. Type the exit <cr> or quit <cr> command at the command prompt. Actually, quit either terminates the Scilab session or decreases the pause level. Thus, if you have paused the session, you may not actually terminate the session.
  2. From the main menu, choose File -> Quit.
  3. Click on the Close button on the Scilab console window.

Screencast

Watch the screencast on YouTube

Task Discussion