<< Chapter < Page Chapter >> Page >
This module is part of the collection, A First Course in Electrical and Computer Engineering . The LaTeX source files for this collection were created using an optical character recognition technology, and because of this process there may be more errors than usual. Please contact us if you discover any errors.

The word matrix dates at least to the thirteenth century, when it was used to describe the rectangular copper tray, or matrix, that held individual leaden letters that were packed into the matrix to form a page of composed text. Each letter in the matrix, call it a i j , occupied a unique position ( i j ) in the matrix. In modern day mathematical parlance, a matrix is a collection of numbers arranged in a two-dimensional array (a rectangle). We indicate a matrix with a boldfaced capital letter and the constituent elements with double subscripts for the row and column:

Figure one is a matrix A describing how the with the notation a_mn, the first letter in the subscript signifies the number of the row, and the second letter in the subscript signifies the number of the column. Figure one is a matrix A describing how the with the notation a_mn, the first letter in the subscript signifies the number of the row, and the second letter in the subscript signifies the number of the column.
Matrix

In this equation A is an m x n matrix, meaning that A has m horizontal rows and n vertical columns. As an extension of the previously used notation, we write A R m x n to show that A is a matrix of size m x n with a i j R . The scalar element a i j is located in the matrix at the i t h row and the j t h column. For example, a 23 is located in the second row and the third column as illustrated in [link] .

The main diagonal of any matrix consists of the elements a i i . (The two subscripts are equal.) The main diagonal runs southeast from the top leftcorner of the matrix, but it does not end in the lower right corner unless the matrix is square ( R m × m ) .

The transpose of a matrix A R m × n is another matrix B whose element in row j and column i is b j i = a i j for 1 i m and 1 j n . We write B = A T to indicate that B is the transpose of A . In MATLAB, transpose is denoted by. A more intuitive way of describing the transpose operation is to say that it flips the matrix about its main diagonal so thatrows become columns and columns become rows. A'

Matrix Addition and Scalar Multiplication. Two matrices of the same size (in both dimensions) may be added or subtracted in the same way as vectors, by adding or subtracting the corresponding elements. The equation C = A ± B means that for each i and j , c i j = a i j ± b i j . Scalar multiplication of a matrix multiplies each element of the matrix by the scalar:

a X = a x 11 a x 12 a x 13 ... a x 1 n a x 21 a x 22 a x 23 ... a x 2 n a x 31 a x 32 a x 33 ... a x 3 n a x m l a x m 2 a x m 3 ... a x m n .

Matrix Multiplication. A vector can be considered a matrix with only one column. Thus we intentionally blur the distinction between R n × 1 and R n . Also a matrix can be viewed as a collection of vectors, each column of the matrix being a vector:

A = | | | a l a 2 ... a n | | | = [ a 11 a 21 | a m 1 a l 2 a 22 | a m 2 a 1 n a 2 n | a m n ] .

In the transpose operation, columns become rows and vice versa. The transpose of an n × 1 matrix, a column vector , is a 1 × n matrix, a row vector :

x = x 1 x 2 | x n ; x T = [ x 1 x 2 x n ] .

Now we can define matrix-matrix multiplication in terms of inner products of vectors. Let's begin with matrices A R m × n and B R n × p . To find the product AB, first divide each matrix into column vectors and row vectors as follows:

Figure two shows how matrices A and B can be cut into a series of column vectors, and then transposed for multiplication purposes. Figure two shows how matrices A and B can be cut into a series of column vectors, and then transposed for multiplication purposes.

Thus a i is the i t h column of A and α j T is the j t h row of A. For matrix multiplication to be defined, the width of the first matrix must match thelength of the second one so that all rows α i T and columns b i have the same number of elements n . The matrix product, C = AB, is an m × p matrix defined by its elements as c i j = ( α i , b j ) . In words, each element of the product matrix, c i j , is the inner product of the i t h row of the first matrix and the j t h column of the second matrix.

For n-vectors x and y , the matrix product x T y takes on a special significance. The product is, of course, a 1 × 1 matrix (a scalar). The special significance is that x T y is the inner product of x and y :

Figure three shows how multiplying the transposed x-column vectors with the y-vectors results in a single vector (x, y) product. Figure three shows how multiplying the transposed x-column vectors with the y-vectors results in a single vector (x, y) product.

Thus the notation x T y is often used in place of ( x , y ) . Recall from Demo 1 from "Linear Algebra: Other Norms" that MATLAB usesto denote inner product. x'*y

Another special case of matrix multiplication is the outer product . Like the inner product, it involves two vectors, but this time the result is a matrix:

Figure four shows the matrix A which results from multiplying matrix x with the transposed matrix of y. Figure four shows the matrix A which results from multiplying matrix x with the transposed matrix of y.

In the outer product, the inner products that define its elements are between one-dimensional row vectors of x and one-dimensional column vectors of y T , meaning the ( i , j ) element of A is x i y j .

There are several other equivalent ways to define matrix multiplication, and a careful study of the following discussion should improve your understanding of matrix multiplication. Consider A R m × n , B R n × p , and C = A B so that C R m × p . In pictures, we have

m [ C p ] = m [ A n ] p B n .

In our definition, we represent C on an entry-by-entry basis as

c i j = ( α i , b j ) = Σ k = 1 n a i k b k j .

In pictures,

Figure 5 shows a specific spot in a matrix, c_ij, that is composed of the multiplication of the transposed column a_i and the column b_j. Figure 5 shows a specific spot in a matrix, c_ij, that is composed of the multiplication of the transposed column a_i and the column b_j.

You will prove in Exercise 3 that we can also represent C on a column basis:

c j = Σ k = 1 n a k b k j .
Figure six shoes how column vector c_j is composed of all of the columns of a_1 through a_n multiplied with the column vector b_j. Figure six shoes how column vector c_j is composed of all of the columns of a_1 through a_n multiplied with the column vector b_j.

Finally, C can be represented as a sum of matrices, each matrix being an outer product:

C = Σ i = 1 n a i β i T
Figure seven shows how matrix C is composed of the addition of each a-column with a respective transposed b-column. Figure seven shows how matrix C is composed of the addition of each a-column with a respective transposed b-column.

A numerical example should help clarify these three methods.

Let

A = 1 2 1 3 2 1 2 4 3 3 2 1 , B = 1 2 1 2 2 1 1 3 2 2 1 1 .

Using the first method of matrix multiplication, on an entry-by-entry basis, we have

c i j = Σ k = 1 4 a i k b k j

or

C = [ ( 1 1 + 2 2 + 1 1 + 3 2 ) ( 2 1 + 1 2 + 2 1 + 4 2 ) ( 3 1 + 3 2 + 2 1 + 1 2 ) ( 1 2 + 2 2 + 1 3 + 3 1 ) ( 2 2 + 1 2 + 2 3 + 4 1 ) ( 3 2 + 3 2 + 2 3 + 1 1 ) ( 1 1 + 2 1 + 1 2 + 3 1 ) ( 2 1 + 1 1 + 2 2 + 4 . 1 ) ( 3 1 + 3 1 + 2 2 + 1 1 ) ]

or

C = 12 12 8 14 16 11 13 l 9 l 1 .

On a column basis,

c j = Σ k = 1 4 a k b k j

c 1 = 1 2 3 1 + 2 1 3 2 + 1 2 2 1 + 3 4 1 2 ; c 2 = 1 2 3 2 + 2 1 3 2 + 1 2 2 3 + 3 4 1 1 ; c 3 = 1 2 3 1 + 2 1 3 1 + 1 2 2 2 + 3 4 1 1 .

Collecting terms together, we have

C = [ c 1 c 2 c 3 ] C = [ ( 1 1 + 2 2 + 1 1 + 3 2 ) ( 2 1 + 1 2 + 2 1 + 4 2 ) ( 3 1 + 3 2 + 2 1 + 1 2 ) ( 1 2 + 2 2 + 1 3 + 3 1 ) ( 2 2 + 1 2 + 2 3 + 4 1 ) ( 3 2 + 3 2 + 2 3 + 1 1 ) ( 1 1 + 2 1 + 1 2 + 3 1 ) ( 2 1 + 1 1 + 2 2 + 4 . 1 ) ( 3 1 + 3 1 + 2 2 + 1 1 ) ]

On a matrix-by-matrix basis,

C = Σ i = 1 4 a i β i T
C = [ 1 2 3 ] [ 1 2 1 ] + [ 2 1 3 ] [ 2 2 1 ] + [ 1 3 2 ] + [ 1 2 2 ] [ 1 3 2 ] + [ 3 4 1 ] [ 1 1 1 ]
= 1 1 1 2 1 1 2 1 2 2 2 1 3 1 3 2 3 1 + 2 2 2 2 2 1 1 2 1 2 1 1 3 2 3 2 3 1 + 1 1 1 3 1 2 2 1 2 3 2 2 2 1 2 3 2 2 + 3 2 3 1 3 1 4 2 4 1 4 1 1 2 1 1 1 1
C = [ ( 1 1 + 2 2 + 1 1 + 3 2 ) ( 2 1 + 1 2 + 2 1 + 4 2 ) ( 3 1 + 3 2 + 2 1 + 1 2 ) ( 1 2 + 2 2 + 1 3 + 3 1 ) ( 2 2 + 1 2 + 2 3 + 4 1 ) ( 3 2 + 3 2 + 2 3 + 1 1 ) ( 1 1 + 2 1 + 1 2 + 3 1 ) ( 2 1 + 1 1 + 2 2 + 4 . 1 ) ( 3 1 + 3 1 + 2 2 + 1 1 ) ]

as we had in each of the other cases. Thus we see that the methods are equivalent-simply different ways of organizing the same computation!

Rotation

We know from the chapter on complex numbers that a complex number z 1 = x 1 + j y 1 may be rotated by angle θ in the complex plane by forming the product

z 2 = e j θ z 1 .

When written out, the real and imaginary parts of z 2 are

z 2 = ( cos θ + j sin θ ) ( x 1 + j y 1 ) = ( cos θ ) x 1 - ( sin θ ) y 1 + j [ ( sin θ ) x 1 + ( cos θ ) y 1 ] .

If the real and imaginary parts of z 1 and z 2 are organized into vectors z 1 and z 2 as in the chapter on complex numbers , then rotation may be carried out with the matrix-vector multiply

z 2 = x 2 y 2 = c o s θ - s i n θ s i n θ c o s θ x 1 y 1 .

We call the matrix R ( θ ) = c o s θ - s i n θ s i n θ c o s θ a rotation matrix .

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, A first course in electrical and computer engineering. OpenStax CNX. Sep 14, 2009 Download for free at http://cnx.org/content/col10685/1.2
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'A first course in electrical and computer engineering' conversation and receive update notifications?

Ask