Search the courses, subjects, tracks, games and features, or jump straight to a page.
Learn it your way
A short class with Sarah and her students. The other ways are under More.
Sign up free to listen. Transcripts are free to read.
Today, we're going to learn how to assign values to variables in SCILAB. Can anyone tell me what a variable is?
Isn't it something you can change, like in math?
Exactly! In SCILAB, we can use the = sign to assign a value to a variable. For example, if I write a = 3.2, a now holds the value 3.2.
What happens if I want to check what a holds?
Good question! You can simply type a and press Enter. SCILAB will display the value stored in a. Let's practice that!
Now that we know how to use variables, let's perform some basic arithmetic operations. What would a + 6.4 do?
It should add 6.4 to the value of a right?
Correct! In SCILAB, we can do this in real-time. Let’s calculate together. What about a - 6.4?
That would subtract 6.4 from a.
That's right. Remember, just use the operators for addition, subtraction, multiplication, and division with your variables!
Let’s discuss the diary function. Can anyone guess what it does?
Is it used to keep a record of our SCILAB commands?
Exactly! By using diary('session1.txt'), we start logging all commands and outputs to a file. How do we stop logging?
I think we use diary(0) to stop it, right?
That's perfect! This is especially useful for documenting your work and findings in SCILAB.
SCILAB has several special constants that you should remember. For instance, can anyone tell me what %pi represents?
%pi is the ratio of a circle's circumference to its diameter, right?
That's correct! And we also have %e for the base of natural logarithms. Let's try using these constants in an expression, like %pi * 2.
Will it give us the circumference of a circle of radius 1?
Exactly! Constants like these make calculations easier. Remember, knowing them is essential!
In SCILAB, a variable is key, Assign it a value, easy as can be!
Imagine a clever mathematician named SCILAB who records all their adventures, capturing numbers and operations into a magic diary, allowing them to revisit their calculations with a simple command.
Remember 'P.I.E.' for 'Pi is Essential' in SCILAB for calculations and constants.
SCILAB: S(C)ientific I(nput) and L(ogging) A(rithmetics and B)asic functions.
Term
What does `diary('filename')` do?
Click to flip
Term
What is `%eps`?
Click to flip
A symbol used to represent a value that can be changed.
A function used to log all input and output commands executed during a SCILAB session into a text file.
The mathematical constant representing the ratio of a circle's circumference to its diameter, approximately 3.14.
The unit imaginary number in SCILAB.
The base of natural logarithms, approximately equal to 2.718.
This section introduces SCILAB's basic input and output commands, guiding users through essential numerical calculations.
In this section, the reader learns about various standard input and output functions in SCILAB, how to perform simple arithmetic operations, create and manipulate variables, and the significance of using the diary function to save session outputs. Important SCILAB constants and commands are introduced as well.
This section provides users with foundational knowledge about input and output functionalities in SCILAB, a powerful numerical computing environment. Users are guided through the critical steps of performing numerical calculations, managing variables, and understanding different output commands.
Variable Assignment: Variables can be assigned values using the assignment operator =. Commands to interact with variables include typical operations (addition, subtraction, multiplication, division) and some special constants like %pi for pi, %i for imaginary units, among others.
Output Management: The diary function captures all output during a SCILAB session to a specified text file. Users learn how to initiate and terminate logging of commands and results effectively.
Special Constants: Understanding key constants ( %eps, %inf, %nan, %t, %f) is essential as they are frequently utilized in calculations.
Command History: SCILAB maintains a command history that allows users to reuse commands easily, fostering a more efficient workflow.
Basic Commands: Usage of basic print functionalities, manipulation of vectors and matrices, and executing calculations are discussed. The section emphasizes how to ensure commands execute correctly without errors, providing a solid groundwork for numerical tasks.