CS 1371 Review Session 3[1] (2)

CS 1371 Review Session 3[1] (2) - CS 1371 Review Session 3...

Info icon This preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 1371 Review Session 3 Electronic Test Bring your Buzzcard and show up to your usual Recitation time. If your computer does not meet the following requirements, you should e-mail your TA ASAP, since you will need to take your test in help desk: Laptop with a battery life > 1.0 hours CD Drive Wireless Connection to LAWN Study the Test Prep coding questions from the last homework, practice test, and ABCs online quizzes. Created By: Dilan D. Manatunga [email protected] ©2009
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CS 1371 Test 3 Topics Matrices Images Numerical Methods Sound Sorting
Image of page 2
Matrices Three Main Topics to Matrices: Matrix Math Solving Systems of Equations 2-D Rotation Matrix Matrices are really just arrays. The usual stuff done with arrays, such as creation, indexing, splicing, concatenation, etc., applies the same to Matrices. The only real difference between matrices and arrays is when doing mathematical operations.
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Matrix Math When doing Matrix Math in MATLAB, remember to not use the dot when doing multiply, divide, or exponentiation. Matrix Multiply C = A*B; NOT C = A.*B; Matrix Divide C = A/B; NOT C = A./B; Matrix Exponentiation C = A^(-1); NOT C = A.^(-1);
Image of page 4
Matrix Multiplication Rules (C = A*B) The order of the multiplication matters. A*B ≠ B*A The number of columns of A must equal the number of rows of B. So, if A is a MxN matrix, then B should be a NxP matrix. The dimensions of the resultant matrix will be the number of rows of A by the number of columns of B. So, if A is a MxN matrix and B is a NxP matrix, then C will be a matrix of dimensions MxP.
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Solving Systems of Equations MATLAB can solve Systems of Equations similar to the methods used in Linear Algebra. Essentially, we are taking the systems of equations and describing it in terms of matrix multiplication. n m nm n n m m b b b x x x a a a a a a a a a 2 1 2 1 2 1 2 22 21 1 12 11 * b x A n m nm n n m m m m b x a x a x a b x a x a x a b x a x a x a 2 2 1 1 2 2 2 22 1 21 1 1 2 12 1 11
Image of page 6
Finding the Matrices The first step to solving the systems of equations is to find the coefficient matrix and the vector of constants. Example: Coefficient Matrix Each row contains the coefficients of a specific equation, while each column contains the coefficients of a specific variable, such as x, y, or z. A = [2, 3; 1 -2]; Vector of Constants Each row contains the constant portion of the equation. b = [9; -13]; 13 2 9 3 2 y x y x 13 9 * 2 1 3 2 y x
Image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Common Mistakes in Creating the Coefficient Matrix Example: For this example, the variable A will contain the coefficient matrix, while the variable b will contain the constant vector.
Image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern