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 will start with scalar operations in SCILAB. A scalar is a single value, and we can perform arithmetic operations with these values. For example, if I set a variable a = 3.2, what arithmetic operations can we perform with it?
We can add, subtract, multiply, and divide it with other scalars!
Exactly! Let’s try it. If a = 3.2 and b = 6.4, how do we express a + b in SCILAB?
We just type a + b and press return!
Correct! Remember, we can also use constants like %pi and %e in our calculations. Can someone give me an example of using one of these?
We can calculate sin(%pi/2)!
Great! Let's recap. We learned to define scalars and perform operations. Remember the acronym 'APPE' for Addition, Subtraction, Product, and Division.
Now, let's move on to vectors. A vector is a collection of numbers. How can we define a vector in SCILAB?
We can use square brackets and separate the values with commas or spaces.
Exactly! For example, to create a row vector v = [-1, 2, %pi], what’s the command to create a column vector?
We can write it as: w = [3; -2; 5].
Well done! Now if I want to plot a function using these vectors, what command do I use?
We can use the plot function, like plot(v, 'b')!
Correct! To assist, remember ‘V’s for Vectors and 'P' for Plot! Let’s summarize our learning: we can create vectors and manipulate them with arithmetic operations.
Let's shift our focus to matrices. Who can tell me how to define a matrix in SCILAB?
A matrix can be defined using rows and semicolons! For example: A = [1, 2, 3; 4, 5, 6].
Excellent! Now, let’s perform some operations with matrices. If A and B are two matrices, how can we add them together in SCILAB?
By typing A + B!
Correct! What about finding the inverse of a matrix? Any ideas?
We would use the inv function like inv(A)!
Perfect! Remember to use 'AM' for Addition of Matrices and 'IN' for Inverse. Summarizing our session: we can create matrices and perform operations such as addition and inverse calculations.
Now, let's explore how we can manage input and output in SCILAB. What function can we use to record our session?
We can use the diary function!
That's right! If we want to save everything we do in a specific file, how do we format the command?
It’s diary('filename.txt').
Exactly! And to stop the diary function, we simply call what?
diary(0)!
Well done! Remember the term 'DIARY' to help you remember this process for documenting your work. In summary, we learned how to save and manage our SCILAB sessions.
Lastly, let’s delve into the command history feature in SCILAB. Why is this feature useful?
It helps us to check back on our previous commands without retyping!
Correct! How do we access previous commands quickly?
By using the Ctrl-P to go back and Ctrl-N to go forward!
Exactly! This makes it very efficient. To remember, think of it as 'CH' for Command History! Let’s summarize: the command history allows us to reuse past commands easily.
Involves assigning values to variables and performing arithmetic operations.
Ordered collections of numbers utilized for various calculations.
Rectangular arrays enabling advanced mathematical computations.
A command to record session data for later review.
A feature for reusing and editing previous commands efficiently.
A scalar's just a number, easy to see, when you add or subtract, as simple as can be!
Imagine SCILAB as a library where each vector is a shelf filled with books. Each operation we perform is like checking out or returning a book.
Use 'DIM' to remember the Diary Input Management in SCILAB for saving and organizing commands.
AM for Addition of Matrices; remember 'AM' to check your matrix operations!
Term
What is a scalar in SCILAB?
Click to flip
Term
How do you create a vector in SCILAB?
Click to flip
Term
What does the diary function do?
Click to flip
A single value or quantity.
An ordered list of numbers represented in SCILAB using square brackets.
A rectangular array of numbers arranged in rows and columns in SCILAB.
A function in SCILAB used to record all commands and outputs of a session into a text file.
A function in SCILAB used to calculate the inverse of a matrix.
This section introduces basic operations in SCILAB, including scalar arithmetic, vector manipulation, and matrix operations.
In this section, readers learn how to perform simple scalar operations, manage vectors, and execute matrix calculations using SCILAB. The section emphasizes hands-on exercises that help users understand SCILAB's functionality, including input, output, and the syntax for comments and variables.
This section serves as an introduction to performing simple operations using SCILAB, a powerful tool for numerical computations. Users are guided through the basics of scalar arithmetic, vector operations, and matrix manipulations. It begins by introducing scalar variables and their assignments, demonstrated with arithmetic exercises involving basic operations like addition, subtraction, multiplication, and division.
%pi, %e, and special functions like exp() and sin().inv()), and solving linear systems.diary function, which records the session data, as well as how to use script files to execute commands in bulk.