The operation can be executed by multiplying the first row by 4 and subtracting it from the second row as in the following command: Let us consider an example where the element in the second row, first column is to be transformed to zero using elementary row and column operation. P = close the square bracket and press enter Recall that in the Spoken Tutorial,Vector Operations, we had defined the matrix P as follows. In linear systems, one of the important sets of operations a user carries out on matrices are the elementary row and column operations.These operations involve executing row operations on a matrix to make entries below a nonzero number, zero. It can be generated using the “rand” command as follows: >eye(4,4) gives a 4 by 4 identity matrixĪ user may need a matrix consisting of pseudo random numbers. It is easy to create an identity matrix using “eye” command: Determine the determinant and eigenvalues of the matrix, A^2+2*AĬertain special matrices can also be created in Scilab:įor example a matrix of zeros with 3 rows and 4 columns can be created using “zeros” commandĪ matrix of all ones can be created with “ones” command as follows Please pause the tutorial now and attempt exercise number one given with the video.ģ. In our keyboard, it is obtained by pressing shift+6. A caret symbol is used to raise a matrix to power, like in ordinary arithmetic operations. Square or cube of a square matrix A can be calculated by simply typing A^2 or A^3 respectively. See 'help spec' to see how eigenvectors can also be obtained using this command. To calculate the inverse and the eigenvalues of a matrix, the commands, “inv” and “spec” respectively, can be used. Recall that in the Spoken Tutorial, Vector Operations, we had definedĪ= close the square bracket and press enter Now, let us learn how to calculate the determinant of a square matrix using the command “det” >Elastcol = E(:,$) close the bracket and press enter For example to extract all rows of the last column of the matrix E, we will type If the size of the matrix is not known $ symbol can be used to extarct the last row or column of that matrix. In the above, the second entry in the bracket, that is, "2 colon 3" makes a reference to elements from column 2 to column 3. >E2 = E(:,2:3) close the bracket and press enter For example, the set of elements starting from second to third columns of E can be obtained using the following command: Colon, when used alone, refers to all the elements of row or column, depending upon whether it appears as a first or a second entry respectively inside the bracket.Īlso, any subset of a matrix can be extracted using a colon (“:”). The command returns all the elements of the first row in the order of their appearance in the row. For example, first row of E can be obtained using the following command: It is easy to extract an entire row or an entire column of a matrix in Scilab. To access the element in the first row and second column, type: Let us now see how to address individual elements of a matrix, separately. Recall that in the Spoken Tutorial, 'Vector Operations', matrix E was defined as It is suggested that the user should practice this tutorial in Scilab simultaneously while pausing the video at regular intervals of time. Start Scilab by double-clicking on the Scilab icon present on the Desktop. I am using Windows 7 operating system and Scilab 5.2.2 for demonstration.You should have listened to the Spoken Tutorial: Getting started with Scilab and Vector Operations.Scilab should be installed on your system.Solve a system of linear equations using scilab. Determine the determinant, inverse and eigen values of aĥ. Welcome to the spoken tutorial on Matrix Operations.Īt the end of this spoken tutorial, you will be able to:Ģ.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |