Tutorial - Hello, World!
that you have
installed Scilab or Scicoslab (they
started being the same software), you're prepared for the basics. Let's
right down to start learning how to program on these possible
Starting Scilab – Scicoslab
are the regular icons for each software.
The Scilab Screen
After Scilab is loaded, your screen looks something like
This "Welcome" message
appears each time you start
Scilab (the image actually corresponds to a Scicoslab session). The
offers you two options:
can type “help” on the command window to see Scilab's built-in help
can start to code there or use the editor.
You can type “clc” to
clear the command window. That’s clearing
the screen to begin typing.
You can open the Editor
by using the top menu.
Let's begin with a look
at the various elements of the Scilab
screen that will help you create programs and process text.
The Scipad Editor
You can open the editor
using the top menu of the command
window or by typing scipad().
The cursor indicates
where the next character you type will
appear on the screen.
In the lower bar of the editor window there are two numbers.
They indicate the current location of the cursor. The first number
which row (line) the cursor is in; the second number tells you which
cursor is in.
Across the top of the
screen or current window is the menu
bar. The menu bar contains the names for all the Scilab drop-down
You can work in only one
window at a time, although it's
easy to switch between the two (just click on the one that you need).
window you're currently working in is called the active window. Note that the title of the
remains “Untitled” until you name the program you type and save it on
Your First Program with Scilab or Scicoslab
Now that you've had a
little hands-on experience with Scilab,
you're ready to type in your first program. Typing in a program is
All you need to do is type in the lines exactly as we show them here,
Enter at the end of each line.
Use the Editor, type the
following two lines:
Save the file as
‘hello_world’. The extension .sce will be
You should have something
similar to this image:
Running or Executing your code
To run your first script
(or program, or code, whatever you
want to call it) use the Execute menu, on the editor window.
You’ll clear the output
window (command window) with the
first line, and then the words Hello, World! will be displayed, like
What you just typed in,
although it's only two lines long,
is a complete Scilab program.
You've learned about one
Scilab keyword, disp
which 1ets your program put information on the screen. Another Scilab
(for CLear Command window) which allows your script to completely erase
the output screen.
You can also run your
Scilab script by typing
on your command window.
The final effect will be the same.
The line above assumes
that you’re working in the same
directory that you used when you saved your file. If you’re not working
same directory, you have to change that, otherwise Scilab won’t run
and will display an error.
pwd is a
command used to verify your working directory.
can always look for the details of commands and
functions by typing
is a command used to change your current directory.
your command window, and you’ll get an explanation from the
Scilab’s online help.
A variation on the line
to execute your file could be
something like this:
where we’re assuming that
you’re working in the directory
in a Windows environment.
You can also type tk_getfile on
the command window, which creates
a dialog window for file selection.
'Scilab Tutorial' to Matlab home
From 'Scilab Tutorial'