Attribution Non-Commercial (BY-NC)

147 views

Attribution Non-Commercial (BY-NC)

- UT Dallas Syllabus for math2333.501.08s taught by Paul Stanford (phs031000)
- Electrical Network Theory
- Mathematics for Physicists Lea Solutions
- ucinet
- chapter_1_2
- Dynamics of serial multibody systems using the decoupled natural orthogonal complement matrices Saha 99-jour.pdf
- Eigens by Row(1)
- Web Lab Manual
- AT-2016-17-C-XI _PAPER-1_-AT+PCM.pdf
- Clustering SVD Master Thesis
- Validating Multiattribute Decision Making Methods for Supporting Group Decisions
- NumPy Arrays Notes
- studenttext
- MatlabCheatSheet.pdf
- IIT JEE 2014 Paper 1 Unsolved
- AFirstCourseInFiniteElements Ch12 MATLAB Copy
- AFirstCourseInFiniteElements-Ch12-MATLAB
- Linear Algebra
- مرجع 9
- 10212_Lectures_2014-15 (1)

You are on page 1of 10

To practice this tutorial, you need to have Scilab installed on your system. Open the scilab console window. Let us start by defining a vector. This can be done in two ways: first one is using spaces -->p = [1 2 3] p = 1. 2. 3.

We can find the length of a vector as follows: -->length(p) ans = 3. We can work with vectors, just as we do in Maths classes. We can add them: -->p + q ans = 3. 5. 7.

and so on. Transpose of a vector can be found using apostrophe. -->p' ans = 1.

2. 3. This is also known as a prime or a single quote. On my keyboard, it is next to the enter or return key. We can calculate p-transpose (times)* q: -->p'*q ans = 2. 4. 6. 6. 9. 3. 8. 12. 4.

The command p times q-transpose gives a scalar: -->p*q' ans = 20. I suggest that you pause at this point and check these calculations. I would want you to do this at regular intervals. When defining matrices, the semicolon is used for defining the next row. For example, define a 2 by 3 matrix P by typing -->P = [1 2 3;4 5 6] P = 1. 4. 2. 5. 3. 6.

Note that this P is in upper case. In Scilab, upper case variables are different from lower case variables. Would you want to check what small p has at this point? The size of a matrix can be obtained by using the size command -->size(P) ans = 2. 3.

-->[row, col] = size(P) col = 3. row = 2. The transpose command works for matrices as well: -->P' ans = 1. 2. 3. 4. 5. 6.

Let us also recall P once more: We can carry out calculations involving P and Q, just as we do in mathematics. For example, let us calculate: -->E = 2*P + 3*Q E = 5. 14. 19. 22. 15. 36.

You may want to verify whether these calculations are correct. We can address the elements of matrices easily. For example, if we want to access the 2,2 element, we give:

-->E(2,2) ans = 22 It is easy to address rows and columns of matrices. For example, the first row of Q is obtained using the following command: -->Efr = E(1,:) Efr = 5. 19. 15.

You see that we get the first row. The semicolon operator says, take everything. Here, it says that we have to take all columns, namely, three columns. Let us recall E. The second to third columns of E are obtained using -->Est = E(:,2,3) I made a mistake so 2 to 3 is given by this colon operator -->Est = E(:,2:3) Est = 19. 22. 15. 36.

Ok you can see that. Let recall what E is. You can see that. The first colon says take everything. 2 to 3 says take from 2 to 3 onwards I have a question for you. What will E(:,:) give? I will not give this command. I would want you to try this out. I would want you to explain why it happens. One of the important operations carried out on matrices is elementary row operations. In this, we have to make entries below a number to be zero. This can be done easily in Scilab. Let us recall P.

Suppose that we want to make the (2,1) entry zero by elementary row operation. That is, we would want to multiply the first row by 4 and subtract it from the second row: -->P(2,:) = P(2,:) - 4*P(1,:) P = 1. 2. 3.

0. - 3. - 6. Would you want to pause and check out this calculation? This procedure can be extended to larger systems and to elementary column operations. We can easily append rows and columns to matrices. For example, if we want to append a row containing [5 5 -2], we do the following: -->T = [P; (go to the next row) [5 5 -2]] (this row is over this operation is over) T = 1. 2. 3.

0. - 3. - 6. 5. 5. - 2.

The semicolon after P says that the numbers coming after should go to the next row. We use matrix notation while solving equations. Suppose that we want to solve this matrix equation: <math> x_1 + 2x_2 - x_3 = 1 </math> <math> -2x_1 - 6x_2 + 4x_3 = -2 </math> <math> -x_1 - 3x_2 + 3x_3 = 1 </math>

This can be written as follows Ax = b The solution is given as Inverse A times b Lets verify whether this is correct A is given as -->A = [1 2 -1;-2 -6 4;-1 -3 3] A = 1. 2. - 1. 4. 3.

- 2. - 6. - 1. - 3.

-->b = [1;-2;1] b = 1. - 2. 1. This is the same system we saw here Let get back here We can calculate x using -->x = inv(A)*b x = - 1. 2. 2. we get this result We can also solve it in scilab with A reverse slash b It is as if this A is taken from this side over here so it comes to the left of b and because A divides b you put a slash in this manner Let us do it in Scilab -->x = A\b

x = - 1. 2. 2. We get the same result The first method involves two steps: calculation of inverse of A and then multiplication with b. A\b just tells Scilab to solve this system. This is done in one step. As a result, A\b is generally more efficient. We can verify the correctness of the solution by back substitution, that is, by calculating Ax-b: -->A*x-b ans = 0. 0. 0. We see that the solution is indeed correct. It is possible that in some systems we may not get zero exactly. But we will get a number close to zero, say, of the order of 10^{-16} or something like that. For square matrices, we can calculate the determinants: Let us recall A first: Lets calculate the determinant of A -->det(A) ans = - 2. We can calculate the square or cube of a square matrix A by simply typing A^2 or A^3. Here we use the carat symbol. In my keyboard, it is obtained by shift 6. One can calculate the eigenvalues of a square matrix by the command spec, which is a short form for spectrum: as i do here -->spec(A)

ans = - 3.7448261 0.3959319 1.3488942 It is possible to calculate the eigenvectors also using the spec command. You can find the syntax for this by giving this command -->help spec I will not give this command, however. Using Scilab we can create special matrices: For example we can create a matrix of zeros with 3 rows and 4 columns using this command -->zeros(3,4) ans =

0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. A matrix of all ones can be created with ones command as follows -->ones(2,4) ans = 1. 1. 1. 1. 1. 1. 1. 1. It is easy to create identity matrices as well: -->eye(4,4) ans = 1. 0. 0. 0. 0. 1. 0. 0. 0. 0. 1. 0. 0. 0. 0. 1.

This is a 4 by 4 identity matrix. We often need matrices consisting of pseudo random numbers. These can be generated by using the rand command as follows -->p=rand(2,3) p= 0.2113249 0.0002211 0.6653811 0.7560439 0.3303271 0.6283918

See help rand for options regarding the distributions and seeds. This brings us to the end of spoken tutorial on Matrix Operations using Scilab. We also have several other spoken tutorial on Scilab at this time. These are listed here. Scilab Effort in India is co-ordinated through this website. scilab.in There are some interesting projects one of them is the Textbook project That codes worked out examples of standard textbooks using scilab The link project allows users to link known scilab documents and to rank them We also help organize Scilab Workshops We have two mailing lists one for announce and another one for discuss. We invite your participation in all our activities Lets get back to spoken tutorials The spoken part will be available in various Indian Languages as well. These are available at spoken-tutorial.org These tutorial form a part of Level 0 training in Scilab. These tutorials are available absolutely free of cost. We wish to cover many FOSS systems through this route. We welcome your feedback on these. We also welcome your participation On writing the outline for the software.

To write the original scripts. To record the spoken tutorial. To translate the script into various Indian Languages. To dub the audio in Indian Languages using the script. To review and give your feedback on all of the above. We welcome you to conduct workshops using these spoken tutorials. We also invite you to conduct efficacy studies on Spoken tutorials. We are also looking for experts who can give technology support for audio, video, automatic translation, etc. We have funding for all these activities The Spoken Tutorials are part of the Talk to a Teacher project, supported by the National Mission on Education through ICT abbreviated as NMEICT given by MHRD government of India. More information on the same is available at this website http://spoken-tutorial.org/NMEICT-Intro. Thanks for joining us. This is Kannan Moudgalya signing off. Goodbye.

- UT Dallas Syllabus for math2333.501.08s taught by Paul Stanford (phs031000)Uploaded byUT Dallas Provost's Technology Group
- Electrical Network TheoryUploaded byLokesh Taneja
- Mathematics for Physicists Lea SolutionsUploaded bybushido_samourai
- ucinetUploaded byLuckyClover
- chapter_1_2Uploaded byTajul Aiman Tajul Anuar
- Dynamics of serial multibody systems using the decoupled natural orthogonal complement matrices Saha 99-jour.pdfUploaded byAdDy Asunción
- Eigens by Row(1)Uploaded byJeeva Jp
- Web Lab ManualUploaded byShreetej Deeshpande
- AT-2016-17-C-XI _PAPER-1_-AT+PCM.pdfUploaded byhiralalnhpc
- Clustering SVD Master ThesisUploaded byNancy LR
- Validating Multiattribute Decision Making Methods for Supporting Group DecisionsUploaded byarie gembul
- NumPy Arrays NotesUploaded byGab Miro
- studenttextUploaded byapi-195130729
- MatlabCheatSheet.pdfUploaded byaskdfjlafsdkj
- IIT JEE 2014 Paper 1 UnsolvedUploaded byRitu Verma
- AFirstCourseInFiniteElements Ch12 MATLAB CopyUploaded byTrung Quoc Le
- AFirstCourseInFiniteElements-Ch12-MATLABUploaded byTrung Quoc Le
- Linear AlgebraUploaded byEdmond Z
- مرجع 9Uploaded byBayan Zatari
- 10212_Lectures_2014-15 (1)Uploaded byrajendrasoloni
- Linear Algebr1Uploaded byShiva Prakash
- Penn Math 240 SyllabusUploaded bya7188839
- Math_1554_Worksheets_Distance_Fall_2018.pdfUploaded byLuke Pearce
- Lab8Uploaded byHaji Zubair
- Final MED_All_Syllabus_180s_with co po.pdfUploaded byAtharv Marne
- 4320A6B8-CUploaded byOnib Nasir
- Ch02Uploaded byDhanushka Rajapaksha
- sample paper-1617-c-10-paper-1Uploaded byapi-306786535
- Syllabus for GATEUploaded byApurva Kumar
- Syllabus for GATE.docxUploaded byApurva Kumar

- 64 Interview QuestionsUploaded byshivakumar N
- OpenCV TutorialUploaded byapi-24457305
- Scripts and Functions With ScilabUploaded byAmitoz Rathore
- Plotting 2 d GraphsUploaded byValan Pradeep
- Iterations in ScilabUploaded byrajatshrivastava22
- Gettingstarted with scilabUploaded byrajatshrivastava22
- SCILAB TUTORIALUploaded byKumar Nori

- akhilUploaded byakhilaneesha
- dnp3_secUploaded byAlfredo Risueño
- Computer AssignmentUploaded byChristine Mae Delima
- AGACAD Booklet 2014Uploaded byDominik Švigir
- Fluenz Version f2 Mandarin Full International Software Crack Key DownloadUploaded byMegatore
- Oracle 9i Database Getting startedUploaded byapi-3707694
- Airwave 762 Release NotesUploaded byvivek
- Auma Manovermodul Ac012 Manual Profibus Data InterfaceUploaded byGregory Farley
- Installation and ConfiguratioUploaded byJavier Gallego Carrasco
- Moss Pig LatinUploaded bynagybaly
- RestaurantSoftware_BuyersGuideUploaded byBuscad0r
- maxima-821-861-usa-v2_65671.pdfUploaded byRoberto Viglino
- Using Oracle Adf With-ebs_sdk_adfUploaded bynhawi
- Excerpt: "Virtually Human" by Martine RothblattUploaded byOnPointRadio
- Vertex User GuideUploaded bymaddiboina
- Theresa Callaway 2018 ResumeUploaded bysophen1
- Z_SEND_MAILUploaded byJulio Rafael
- Joomla Manual.docxUploaded byRhenz Hall
- T45-30L-905Uploaded byDario Šafranko
- SRMUploaded bysrinivasa varma
- 454068 Post Media Aesthetics 1Uploaded byAna-Maria Huluban
- Motor Starting - Open ElectricalUploaded byHerman Damanik
- VHDL is a Hardware Description LanguageUploaded bydeviprasadmishraips
- Logic SlidesUploaded byArun Manick
- ch1Uploaded bygeraldsrc
- LG G2 D802 User ManualUploaded byshoshon021
- Adopting DevOps: Overcoming Three Common Stumbling BlocksUploaded byCognizant
- Industrial ComputersUploaded byfantasmaos
- KimiosBundleDeployer-EN.pdfUploaded byEvi Viana Surya
- 46 xx SettingsUploaded bytzarinchilla