Scilab Familarization - Lopez
Scilab Familarization - Lopez
THE CONSOLE
The first way is to use Scilab interactively, by typing commands in the console, analyzing the
results and continuing this process until the final result is computed. This document is designed
so that the Scilab examples which are printed here can be copied into the console. The goal is
that the reader can experiment with Scilab behavior by himself. This is indeed a good way of
understanding the behavior of the program and, most of the time, it is a quick and smooth way
of performing the desired computation.
THE EDITOR
The editor can be accessed from the menu of the console, under the Applications > Editor menu,
or from the console, as presented in the following session. This editor manages several files at
the same time, as presented in figure 5, where we edit five files at the same time. There are
many features which are worth mentioning in this editor. The most commonly used features are
under the Execute menu.
We can double click on a variable, which opens the variable editor, as presented in the figure 12.
We can then interactively change the value of a variable by changing its content in a cell. On the
other hand, if we change the variable content within the console, we must refresh the content
of the dialog box by pushing the refresh button in the toolbar of the Variable Editor.
The Edit menu provides a very interesting feature, commonly known as a ”pretty printer” in
most languages. This is the Edit > Correct Indentation feature, which automatically indents the
current selection. This feature is extremely convenient, because it formats algorithms, so that
the if, for and other structured blocks are easy to analyze.
The editor provides a fast access to the inline help. Indeed, assume that we have selected the
disp statement, as presented in figure 7. When we right-click in the editor, we get the context
menu, where the Help about ”disp” entry opens the help page associated with the disp function.
Docking
The graphics in Scilab version 5 has been updated so that many components are now based on
Java. This has a number of advantages, including the possibility to manage docking windows.
The docking system uses Flexdock [12], an open-source project providing a Swing docking
framework. Assume that we have both the console and the editor opened in our environment,
as presented in figure 8. It might be annoying to manage two windows, because one may hide
the other, so that we constantly have to move them around in order to actually see what
happens.
The title bar in the source window. In order to dock the editor into the console, drag and drop
the title bar of the editor into the console.
The Flexdock system allows us to drag and drop the editor into the console, so that we finally
have only one window, with several sub-windows. All Scilab windows are dockable, including
the console, the editor, the variable browser, the command history, the help and the plotting
windows. In figure 9, we present a situation where we have docked four windows into the
console window.
In order to dock one window into another window, we must drag and drop the source window
into the target window. To do this, we left-click on the title bar of the docking window, as
indicated in figure 8. Before releasing the click, let us move the mouse over the target window
and notice that a window, surrounded by dotted lines is displayed. This ”phantom” window
indicates the location of the future docked window.
We can choose this location, which can be on the top, the bottom, the left or the right of the
target window. Once we have chosen the target location, we release the click, which finally
moves the source window into the target window
Scilab provides a variable browser, which displays the list of variables currently used in the
environment. Figure 11 presents the state of this browser during a session.
The Command History dialog allows browsing through the commands that we have previously
executed. This dialog is available in the menu Applications > Command History and is presented
in the figure