{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CS1371_06_Vectors_Matrices

# CS1371_06_Vectors_Matrices - CS1371 Introduction to...

This preview shows pages 1–8. Sign up to view the full content.

1 CS1371 Introduction to Computing for Engineers Vectors and Matrices

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

View Full Document
2 Vectors and Matrices Lecture Creating arrays and matrices Accessing matrix components Manipulating matrices Matrix functions Solving simultaneous equations Regression analysis Learning Objectives Understand the nature of matrices Understand how to manipulate matrices in Matlab
3 Vectors and Matrices We’ve referred to vectors and matrices frequently… but exactly what are we talking about? what is a matrix? is it different from an array? ANSWER: vectors and matrices are arrays with an “attitude” that is, they look just like an array (and they are arrays), but they live by a very different set of rules! Vectors: Can you explain what, if anything, results from these operations with vectors? Can you explain what, if anything, results from these operations with vectors? f + b = ? 3f = ? f g = ? S x r = ? | h | = ? A / b = ?

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

View Full Document
4 Why Matrices? A matrix is an array that obeys a different set of rules but multiplication, division, etc. are DIFFERENT ! a matrix can be of any dimension but 2D square matrices are the most common by far A large and very useful area of mathematics deals with what is called “linear algebra” and matrices are an integral part of this. Many advanced computational methods in engineering make extensive use of linear algebra, and hence of matrices
5 A Simple Example A set of simultaneous linear algebraic equations will often arise in engineering applications How do you solve these? Solve first for x in terms of y; substitute in second and solve for y; use this in first to find x Use “Cramer’s Rule” Other? Let’s try a more abstract notation: 3 2 14 4 14 x y x y - = + = - 3 2 14 1 4 14 x y -    =   -    C*z = b OR

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

View Full Document
6 A Simple Example-cont’d What do we mean by the * for this form? Note that the column matrix, z, is multiplied times the first row of C on an element-by-element basis and the results are summed to get the first row of the answer Ditto for the second row… This is NOT array multiplication; it is matrix multiplication For two 2D matrices in general: 3 2 3 2 * 1 4 4 x x y y x y - -    = =   +    C*z 1 : N ij ik kj k where c a b = = A*B = C NOTE: the number of columns in A must be equal to the number of rows in B (N in this example) NOTE: the number of columns in A must be equal to the number of rows in B (N in this example)
7 A Few Notes on Matrices Matlab handles matrix multiplication with the * symbol (NOTE: this is NOT array multiplication!) From our formula we see that in general: A*B B*A In other words, matrix multiplication is NOT commutative Matrices behave just like arrays for addition and subtraction

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 49

CS1371_06_Vectors_Matrices - CS1371 Introduction to...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online