 Hello friends, I am Naval Emul working as Assistant Professor in Mechanical Engineering Department Vulture and Institute of Technology, Swarapur. In this video, we are going to see SciLAB, Skillars and Vectors Part 1. Learning Outcome At the end of this session, students will be able to perform vector calculations on SciLAB. Content Introduction Initializing Vectors in SciLAB Mathematical Operations on Vectors Introduction SciLAB, just like MATLAB focuses on matrices for handling huge data. A matrix is just a rectangular array of rows m and columns n. We refer to it in mathematics as an m into n matrix. When a matrix has a single row of numbers, we call it as a row vector. So, here m shows a row vector where the matrix has a single row where the matrix represents a single column is called as a column vector where n shows a column vector. So, let us see how to initialize vectors in SciLAB that is row vector and column vector. Basically, vectors are denoted by a square brackets in SciLAB. You need to remember this point whenever you want to input a vector, square brackets are used in SciLAB. A sequence of numbers separated by a comma or simply space defines a row vector. So, whenever we are giving a row vector comma or simply a space is used to define a row vector. For example, here m is a variable and there are five elements in the square bracket, 35 comma 45 comma 65 comma 79 comma 23 represents a row vector or else you can give a space also between the elements. In the same way, the same data can also be arranged in a column vector. Here the sequence of numbers are separated by the semicolon. Here m is the elements are separated by the semicolon that is 35 semicolon 45 semicolon 65 semicolon 79 semicolon 23. The vector we get is a column vector that is in one column. So, we will give a quick calculations on a SciLAB window. So, this is a SciLAB console window where we perform the same operations what we have done now. So, m I am giving a vector row vector with a square brackets and the elements in that you can give a space or you can give a comma also there is no problem and just press enter the m that is row vector is defined. In the same way we can define a column vector that n you can take any variable same square brackets, but between the elements you need to give a semicolon semicolon then a element then semicolon then element. So, just type enter you get the n as a column vector. So, this is a method to give a row vector and this as a column vector. So, SciLAB has some short and notations if the vector is an arithmetic progression of numbers. For example, to define 1 to 10 we have a command as follows a is equal to 1 colon you need to remember here it is colon 1 colon 10 where you get the output as 1 to 10. Here the starting number is 1 increment value in the middle and the upper limit at the last. So, 1 is the first number 10 is the last number and middle number that is incrementing value. So, you get the output from 1 to 10. Suppose if you want to specify all the given all the even numbers from 2 to 20 the function of the command would be 2 colon 2 colon 20 that first 2 is for the first number and this 20 as a last number and from 2 to 20 the increment should be 2. So, you get the output as 2 4 6 8 and so on. So, we will do this 2 calculations on the SciLAB window and solve window. So, I will take a vector. So, the short and to type 1 to 10 that is 1 colon then 1 that is incrementing 1 then last number should be 10. I will just press enter. So, we will get a row vector from 1 to 10. In the same way we can take a take a square bracket 2 colon 2 colon 20. So, you get all the even numbers starting from 2 and ending at 20. So, you get all the even numbers from starting from 2 to 20. I will clear this console window. To clear the console window the command is CLC enter. So, it will ask to clear the console just clear it will go further. The increment that is the starting value and end value can be a fraction also. Here let us see an example 0 colon 0.3 colon 1 where 0.3 is in fraction the first number is 0 and it is incremented as 0.3 and the last number is closest to the ending value. It is not exactly the end value whenever you have a fraction you will get this case. If you are interested in creating a row vector or a column vector of all elements 0 it can be done using a special 0 function. So, in salab it is a special function called 0 function where you need to get if you want all row call row vector or a column vector as 0 elements the command is like 0 1 comma 5 where 1 first place 1 indicates that is row and 5 indicates there are 5 0's. In the same way we can do for column vector that is 0's this is a function 0's 2 there are 2 0's with 1 1 indicates it is a column. So, 0 comma 0 you can see in a salab window here suppose I will take a d element d is equal to 0's 1 that is row comma 5 and I will complete the bracket press enter. So, in one row there are 5 elements and all 5's are 0's I will take other e as 0's in bracket 3 comma 1 the 3 indicates there are 3 0's and 1 is a column. So, 3 0's in column think pause the video for a few seconds lease down the various vector operations you know let us see the vector operations we can perform on the salab. So, mathematical operations on vectors the various mathematical operations possible and vectors are listed as follows we can do addition of vectors subtraction multiplication division element wise multiplication element wise division then transpose the first addition the addition of the two vectors a and b is performed using plus operator both operators must be of same size it is not possible to add a row vector and a column vector. So, whenever we are using a addition or plus operator that two should be a column vector or two should be a row vector suppose here a and b both are a row vector you can add this by a operator plus a plus b adding two vectors you get the output as 10 plus 5 as 15 20 plus 10 as 30 30 plus 15 as 45. In the same way you get subtraction here we use minus operator very simple and both should be of row vector or a column vector. So, a minus b the answer would be 5 10 minus 5 5 20 minus 10 10 30 minus 15 50. So, we will have a quick calculations here like if I give a a vector as 5 space 10 space 15 bracket complete a row vector is defined b is equal to 15 space 20 space 25 just press enter you will get two vectors defined you can add a plus b is equal to a minus b enter. So, I will you can see the calculations very simple. So, further we can go with the multiplication in multiplication while performing multiplication of vectors one should be in row and other vector should be in column then only you can perform multiplication operation. For example, here a is in vector row vector and b is a column vector here you can see the semicolon between them between the elements it represents a column vector here a into b gives you a 700 here a is a row vector and b is a column vector for division is usually performed between a and b as a row vectors here you can see a and b is the operator used is slash sign here for division. So, a divided by b you get 2. So, this is element wise multiplication for element wise multiplication the operator we use is dot and asterisk that is dot multiplication that is element wise multiplication here also the condition is same you need to have vectors of same size a and b to row vectors here we can use dot asterisk that dot multiplication we get first element is multiplied with first element of vector b that is 5 10 into 5 you get 50 in the same way the calculations are performed. Element wise division the operator is used as dot slash here. So, a dot slash b you get the answer with element wise division these are the references thank you.