WSQ14: SciLab

#Tc1017 #SciLab

SciLab is a numerical computation software which is quite handy and also easier to understand than C++ in my opinion, its graphic options are very useful as well, and the handling of matices is definitely more intuitive than in C++.

Understanding SciLab:

  1. On the console screen, we can use the arrows to change instructions and find the history of used commands, kinda like how we use the arrow keys in the compiler.
  2. When using the console we have to input first –> before any command
  3. Basic operations and inserting comments remain the same as in C++.
  4. We can use %e, %pi and %i to represent euler’s constant, pie and complex numbers.
  5. The semicolon is used to avoid any result from beign displayed, no compiling error will occur here.
  6. More useful than the console screen is the editor, which is basically a word processor in which coding becomes easier.

Plotting in SciLab:

  1. Command: plot.
  2. clf menas clear plot, while scf opens another window.
  3. Colors can be added to curves: letter enclosed by “” –> “b” makes blue
  4. Point styles work the same
  5. Segments go in square brackets, point go in round ones.
  6. Statistics: useful for creating bar graphs
  7. Use bar command –> bar (x,n,color)

Creating functions:

  1. Begin: function
  2. End: endfunction
  3. Variables must always have a value, but we don´t have to declare them in advanced😀
  4. Function’s parameters work the same as in C++
  5. Logical operators remain the same, only != becomes <>

Matrices and vectors:

  1. Al operations are done with matrices.
  2. A space or coma separates columns.
  3. Semicolons separate rows.

Loops:

  1. Beggining:step: value –> this way is much simpler than C++
  2. For and while finish with an end.

CC BY-SA 4.0 WSQ14: SciLab by diegodamy is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.