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.

WSQ14-SciLab

SciLab is an incredibly useful software used to perform complex mathematical calculations, plots, etc. It works using  matrices. As explained in their introductory document:

“Scilab is not a computer algebra system. It calculates only with numbers. All calculations are done with matrices, although this may go unnoticed. Even if the concept of matrices is unknown, vectors and sequences of numbers can explain it, as they are, in fact, matrices of dimension 1 × n or n × 1 and a number is itself a matrix of dimension 1 × 1”

scilab.png

Take a look at a quick introductory video, made by myself (IN SPANISH):

WSQ14

 

photodune-3007348-confused-boy-with-a-computer-s

(yo viendo sobre scilab)

Yo creo que Scilab es usado más que nada para cálculos matemáticos, sin embargo, tiene también su parte de “programación”, es sencillo; tiene tipos de variables pero no es necesario definirlas.  En scilab también existen los tipos de datos pero no es necesario definirlos.

Se pueden crear o definir funciones y cuando se terminen se debe poner un endfunction. y para llamar a una función es igual que en python, se pone el nombre de la funcion y los argumentos. Scilab tiene sus “SciNotes” para que puedas escribir todo el procedimiento sin andar desplegando cada valor como en la consola, finalmente guardas la nota y lo corres.lala Ahí esta un ejemplo de operación (pitagoras) hecho desde notas y otro directo en la consola.

2016-05-03 (4)
El “disp()” sirve para imprimir algun valor en la consola. Eso se puede poner tambien en las notas, pero lo olvidé.

 

2016-05-03 (2)
Se guardan los valores, después se ejecuta linea por linea. Ignoren lo de atrás :v es spoiler.

Un ejemplo de lo que se puede hacer que hicimos en python,… para no romperme la cabeza será el de producto punto…

2016-05-03 (5)
jajajaj sentí que eso fue muy feo y primitivo, pero salió.

Probablemente se pueda hacer mucho más estetico, con una función, por ejemplo pero solo es una pequeña practica y son finales :l
En resumen: Scilab es sencillo para calculos matematicos, por ahí vi que también se pueden graficar funciones, etc.  Se pueden hacer diferentes operaciones de matrices y crear super rapido, por columnas y filas. por ejemplo.

2016-05-03 (5)
con el “;” se hace que se cree otra fila.

Con el calculo super matematico que hice para el producto punto, fue que le decía a la cosa esa ->> x(1,1) <<- quiere decir que de x en la fila 1- columna 1 agarre el

Continue reading “WSQ14”