Métodos Computacionales Public

  • Email
  • Share
  • Contributors
  • Close Course

Desarrollo de competencias TIC's para aprender a usar un Lenguaje de programación para resolver problemas de ingeniería

Module Information

2 First steps In this section, we make our first steps with Scilab and present some simple tasks we can perform with the interpreter. There are several ways of using Scilab and the following paragraphs present three methods: • using the console in the interactive mode, • using the exec function against a file, • using batch processing. We also present the management of the graphical windows with the docking system. Finally, we present two major features of Scilab: the localization of Scilab, which provides messages and help pages in the language of the user, and the ATOMS system, a packaging system for external modules.   2.1 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. In the following example, the function disp is used in the interactive mode to print out the string ”Hello World!”. --> s="Hello World!" s = Hello World! --> disp(s) Hello World! In the previous session, we did not type the characters ”–>”which is the prompt, and which is managed by Scilab. We only type the statement s=”Hello World!” with our keyboard and then hit the key. Scilab answer is s = and Hello World!. Then we type disp(s) and Scilab answer is Hello World!. When we edit a command, we can use the keyboard, as with a regular editor. We can use the left ← and right → arrows in order to move the cursor on the line and use the and keys in order to fix errors in the text. In order to get access to previously executed commands, we use the up arrow ↑ key. This lets us browse the previous commands by using the up ↑ and down ↓ arrow keys. The key provides a very convenient completion feature. In the following session, we type the statement disp in the console. --> disp
Show less