Post of the weeks #11,12,13,14,15 and 16 what things I learned in these weeks ? And Index of Mastery Topics

Post of the weeks #11,12,13,14,15 and 16 what things I learned in these weeks ? And Index of Mastery Topics

Picture of author

First let me tell you that  I learn and achieved all transversal topics and you can see it in the following link: Post of the week #3 what things i learned in this week #3 ? And Index of Mastery Topics

I also explain my project and formed a small team that corresponds of completing this ability to create C++ project in IDE and run inside the IDE and can be explained in my post My Project For the Course TC1017 and Expo Ing. Let’s code!

Futhermore, I am going to present the report of all the Mastery Topics achieved in this week:

  1. #Mastery01 Use of comments, achieved in: Post of the week #2 what things i learned in this week #2 ?
  2. #Mastery02 C++ Good Style coding conventions, achieved in: Post of the week #2 what things i learned in this week #2 ?
  3. #Mastery03 Basic types and their use, achieved in: Post of the week #2 what things i learned in this week #2 ?
  4. #Mastery04 Basic output (print), achieved in: Post of the week #2 what things i learned in this week #2 ?
  5. #Mastery05 Basic user input (text based), achieved in: Post of the week #2 what things i learned in this week #2 ?
  6. #Mastery06 Calling functions, achieved in: #Quiz03. Also here:#WSQ08 Yo soy 196 11/03/17 and WSQ08.cpp
  7. #Mastery07 Creating functions, achieved in: #Quiz03. Also here: #WSQ08 Yo soy 196 11/03/17 and WSQ08.cpp
  8. #Mastery08 Importing and using libraries, achieved in: Post of the week #1 what things i learned in this week #1 ? Also in #WSQ08 Yo soy 196 11/03/17 and WSQ08.cpp
  9. #Mastery09 Creating and using your own libraries (program with multiple files), achieved in: #Quiz03. Furthermore, also in here: #WSQ08 Yo soy 196 11/03/17 and WSQ08.cpp
  10. #Mastery10 Use of the conditional “if”, achieved in: #WSQ02 Post Temperature 23/01/17 and WSQ02.cpp
  11. #Mastery11 Use of “else” with a conditional if, achieved in: #WSQ02 Post Temperature 23/01/17 and WSQ02.cpp
  12. #Mastery12 Nesting of conditional statements (ifs inside ifs): #WSQ02 Post Temperature 23/01/17 and WSQ02.cpp
  13. #Mastery13 Use of loops with “while” and “do while”, achieved in: #WSQ03 Post Pick a Number 23/01/17 and WSQ03.cpp
  14. #Mastery14 Use of loops with “for”, achieved in: #WSQ04 Post Sum of Numbers 23/01/17 and WSQ04.cpp
  15. #Mastery15 Nested loops, achieved in:#WSQ08 Yo soy 196 11/03/17 and WSQ08.cpp
Anuncio publicitario

#WSQ13 SciLab 16/04/17

#WSQ13 SciLab 16/04/17

scilabp (1)

Link of picture

So in this fourteen week class I started with doing this WSQ13 and I started reviewing in creating and calling functions in C++.#Mastery06, #Mastery07, #Mastery16 Use of recursion for repetitive algorithms, #Mastery17 When to use what type of repetition in a program, #Mastery18 Creation and use of Arrays/ Vectors in C++. Furthermore, in this stage I have all the topics of the course from 1 to 24.

What I did for this numeric program is using Scilab. Scilab is a great tool that I believe I will find very useful during the rest of my degree programs and beyond. The motivation here is simply to introduce me to the tool. Scilab is open source software and runs on Linux, Mac and Windows

Please download and “play with” SciLab.

The resources I need it to play with Scilab are:

Download the latest version at http://www.scilab.org/download/latest

Please follow the tutorial available on their website under Resources->Documentation. Here is the direct link to the tutorial http://www.scilab.org/content/download/849/7901/file/Scilab_beginners.pdf

Page for SciLab to download at https://www.scilab.org

SciLab is an incredibly useful software used to perform ALL mathematical calculations, plots AND even control Microcontrollers!!. It works using commands from the Matlab software and you can also play with this software . As explained in their introductory document:

As we can see in the next pictures we have the #Mastery23 Data analysis with tools (to be determined which tool, most likely SciLab) and #Mastery24 Visualization of data with tools where we have a command to give a value to a variable and using the command plot for graphics we can see the behaviour of that variable of the graphic. For example, if we have these commands:

>> x=0: pi/100: 2*pi;% son los valores del inicio en cero luego el incremento es pi/100 y despues la tercera la longitud de 2 pi.

>> y=sin(x); %en la funcion del seno de x

plot(x,y)%Dibuja un gráfico y grafica las coordenadas x y

sin x and cos x

The folowing is the basic operations that can calculte SciLab

>> 2+2 % suma de 2 y 2

ans =

4.00

>> sin(3) % valor del seno de 3 en radianes

ans =

0.14

>> cos(3) % valor del coseno de 3 en radianes

ans =

-0.99

>> tan(3) % valor de la tangente de 3 en radianes

ans =

-0.14

>> sqrt(25) % valor de la raiz cuadrada de 25

ans =

5.00

log10(3) % valor del logaritmo de base 10 de 3

ans =

0.48

>> log(3) % valor del logaritmo natural de base e de 3

ans =

1.10

>> abs(-3) % Valor absoluto de 3

ans =

3.00

>> exp(0) % exponente ala cero, para cualquier numero

ans =

1.00

>> pi% valor del numero racional de pi

ans =

3.1416

>> i% la unidad imaginaria que es la sqrt(-1), es la misma que la j

ans =

0 + 1.0000i

>> j% la unidad imaginaria que es la sqrt(-1), es la misma que la i

ans =

0 + 1.0000i

>> x=pi% es una igualdad donde x tiene el valor de pi

x =

3.1416

>> format rat % buscar una aproximación racional de un numero

>> pi % por ejemplo el número pi

ans =

355/113

>> format long % expander los numeros racional e irracionales hasta 16 dígitos

>> pi por ejemplo

ans =

3.141592653589793

>> format short e % expander los numeros racionales e irracionales hasta 5 dígitos más exponente

>> pi % para pi por ejemplo

ans =

3.1416e+00

>> format long e % formato numérico de expander los números racionales e irracionales hasta 16 digitos más exponente.

>> pi % para pi por ejemplo

ans =

3.141592653589793e+00

>> format hex % formato de números numericos a sistema hexadecimal

>> pi% para pi por ejemplo

ans =

400921fb54442d18

>> format bank % formato numerico que muestra los numeros en 2 decimales

>> pi como es pi por ejemplo

ans =

3.14

>> x=0: pi/100: 2*pi;% son los valores del inicio en cero luego el incremento es pi/100 y despues la tercera la longitud de 2 pi.

>> y=sin(x); %en la funcion del seno de x

>> plot(x,y)%Dibuja un gráfico y grafica las coordenadas x y

>> x=0: pi/100: 4*pi;% son los valores del inicio en 0 luego el incremento en pi/100 y despues la tercera la longitud en 4 pi

>> y=sin(x); %en la funcion del seno de x

>> plot(x,y)%Dibuja un gráfico y grafica las coordenadas x y

>> x=0: pi/100: 8*pi;% son los valores del inicio en 0 luego el incremento en pi/100 y despues la tercera la longitud en 8 pi

>> y=sin(x); %en la funcion del seno de x

>> plot(x,y)%Dibuja un gráfico y grafica las coordenadas x y

>> x=5: pi/100: 8*pi;% son los valores del inicio de 5 luego el incremento de pi/100 y despues la tercera la longitud en 8 pi

>> y=sin(x); %en la funcion del seno de x

>> plot(x,y)%Dibuja un gráfico y grafica las coordenadas x y

>> x=5: pi/200: 8*pi;% son los valores del inicio de 5 luego el incremento de pi/200 y despues la tercera la longitud en 8 pi

>> y=sin(x); %en la funcion del seno de x

>> plot(x,y)%Dibuja un gráfico y grafica las coordenadas x y

>> x=10: pi/200: 16*pi;% son los valores del inicio de 10 luego el incremento de pi/200 y despues la tercera la longitud en 16 pi

>> y=sin(x); %en la funcion del seno de x

>> plot(x,y)%Dibuja un gráfico y grafica las coordenadas x y

>> xlabel(‘aqui va la x’)% etiqueta a la variable x

>> ylabel(‘aqui va la y’)% etiqueta a la variable y

>> title(‘titulo general’) % agrega un titulo ala grafica actual

>> title(‘titulo general’,’Fontsice’,’36) % agrega un titulo ala grafica actual con su respectivo tamaño

x=0: pi/100: 2*pi;% son los valores del inicio de 0 luego el incremento de pi/100 y despues la tercera la longitud en 2 pi

>> Y1=sin(x); % en la función 1 del seno de x

>> Y2=cos(x); % en la función 2 del coseno

plot(x,Y1,x,Y2); % Dibuja un gráfico y grafica las coordenadas x en función de Y1 y x en función de Y2

legend(‘sin(x)’,’cos(x)’)% leyenda en un grafico

>> a=’Mexico’ % Asignar el valor de una variable de texto a

a =

Mexico

>> b=’Argentina’ % Asignar el valor de una variable de texto b

b =

Argentina

e=’Brazil’ % Asignar el valor de una variable de texto c

e =

Brazil

>>a(3:7)

ans =

x:i

>> a(3:5)

ans =

xic

>> a(1:3)

ans =

Mex

>> X1=[a,b]

X1 =

MexicoArgentina

>> X1=[a,e]

X1 =

MexicoBrazil

>> X1=[b,e]

X1 =

ArgentinaBrazil

>> Y1=[a(1:3),b(1:4),e(5)]

Y1 =

MexicoArgentina

>> length(a) % largo de un vector a

ans =

6.00

>> length(b) % largo de un vector b

ans =

9.00

>> length(c) % largo de un vector c

ans =

6.00

>> stromp(a,c)

ans =

0.00

>> Mex=’Mexico’

Mex =

Mexico

>> stromp(a,Mex)

ans =

1.00

>> h=upper(a)

h =

MEXICO

>> lower(h)

ans =

mexico

If you want a plot in 3d you need the command mesh or surf and we need these commands:

–> x=-1:0.1:3;

–> y=1:0.1:4;

–> [X,Y]=meshgrid(x,y);

–> surf(Y)

surf

Furthermore, we can do pie charts:

x=[1 2 3 4.5 %e]; //Remember %e is e=2.71…..

–> pie(x)

pieee

You can also do it for control microcontrollers that made me love more this open source software:

Using Scilab for microcontrollers

And i also resolved it by doing this video tutorial that i made reafirming these parts at this link :#WSQ13 Tutorial 14 SciLab 15/04/17 SciLab codes Mastery 23 and 24

Link of the resources to play with Scilab in Github:

Commands in Github

Commands in Github

Graphic commands

More commands

Some commands that appear with Matlab