# Matrix Operations

## Matrix Definitions

A matrix is a rectangular array of numbers called the entries (also called
the elements ) of the matrix. The following are all matrices:

The size of a matrix is the number of rows and columns. An m × n matrix
has m rows and n columns.

Ex: What are the sizes of each of the matrices given above?

Note: A vector is also a matrix. A row vector is a 1 × n matrix (called a row
matrix). Similarly a column vector is a m × 1 matrix (called a column matrix).

The entries of a matrix A are denoted by aij where i is the row number and
j is the column number. For example, in

we have a11 = 0, a21 = −4, and a23 = .

## Matrix Definitions (2)

We write a general matrix A as

We can also write

where aj are the columns of A and Ai are the rows of A.

The diagonal entries of A are a11, a22, . . . . How many diagonal entries are
there if m > n ?

## Matrix Definitions (3)

If A is an n × n matrix then it is called a square matrix .

Example of square matrix :

A square matrix with zero nondiagonal entries is called a diagonal matrix

Example of diagonal matrix :

A diagonal matrix with equal diagonal entries is called a scalar matrix .

Example of scalar matrix :

A scalar matrix with values of 1 on the diagonal is an identity matrix .

Example of identity matrix (always called I) :

## Matrix Operations

Two matrices are equal if they have the same size and the same entries.
The sum of two matrices is defined by elementwise. This makes sense only
if the matrices are the same size.

If c is a scalar and A is a matrix then cA is defined by multiplying each entry
of A by c.

Matrix subtraction is defined as A − B = A + (−B).

## Matrix Multiplication

The product of two matrices is NOT d one componentwise . If A is an m × n
matrix and B is an n × r matrix, then the product C = AB is an m × r
matrix given by:

The ijth entry of C can be thought of as the ith row of A multiplied by the jth
column of B.

Note: A and B need not be the same size. The number of rows of A must be
the same as the number of columns of B. In terms of sizes , we have:
m × n · n × r = m × r.

## Linear Systems as Ax = b

Suppose we wish to solve

We can write Then
solving the linear system is equivalent to solving the system Ax = b for x. In
fact, the augmented system [A|b] really means Ax = b.

Thm: Let A be an m × n matrix, ei a 1 × m standard unit vector, and ej an
n × 1 standard unit vector. Then
(a) eiA is the ith row of A and
(b) Aej is the jth column of A.
Pf: Do by direct calculation .

## Partitioned Matrices

We can write a matrix in terms of submatrices with the matrix partitioned
into blocks . For example, we can write:

We can partition a matrix into row or column vectors. If B is an n × r matrix
partitioned into column vectors, then If A is m × n then

If we write A as row vectors, then using the same idea we can write

## Matrix Powers and Transpose

If A is an n × n matrix, then we can define A2 = AA, A3 = AAA, etc. As
usual, we define A1 = A and A0 = I.

Thm: If A is a square matrix, and r, s are non negative integers , then

The transpose of an m × n matrix A is the n × m matrix AT obtained by
inter changing the rows and columns of A. A square matrix A is symmetric
if AT = A.

## Matlab Matrix Operations

Most usual operations work as expected in Matlab. It will return an error if
you do something incorrectly, like add two matrices of different sizes . The
transpose operator is ′. An identity matrix is formed using the eye command.
A zero matrix can be formed using zeros. Try the following:
» A = [2,3;4,5]
» B = [-2,-1;0,3]
» C = eye(2,2)
» D = zeros(2,2)
» A+2*B
» B-C
» A

Block matrix operations work exactly as expected as well. To define a 4 × 4
block matrix

we simply define a 2 × 2 matrix with matrices as elements:
» G = [A,B; C,D]

## Matlab Matrix Multiplication

Matrix multiplication brings up an interesting issue in Matlab. Let us say we
wish to find Ak as k → ∞ for

Everything works as expected in Matlab:
» A = [0,1/2;1,1/2];
» A^2
» A^8
» A^16
What does it look like this is approaching ? We find

Similarly, we can multiply two different matrices:
» B = [0 1; 1 1; 1 2];
» B*A
» A*B
What will happen when we try A*B? We’ll get an error since A*B is not well
defined?

## Matlab Matrix Multiplication (2)

Matlab also has the ability to apply operations to entry in dividually . If we use
the . command before an operator, then each operation is defined
componentwise. Note that this is ONLY defined for matrices of the same
size.

Using componentwise arithmetic , we have

So we can try:
» A.^2, A.^8, A.^16
We find

Similarly, we can multiply A componentwise to a matrix B of the same size:
» B = [0 1; 1 1];
» A.*B
» B.*A
Note A. * B = B. * A but in general AB ≠ BA for A and B of the same size.

 Prev Next

Start solving your Algebra Problems in next 5 minutes!

 Algebra Helper Download (and optional CD) Only \$39.99 Click to Buy Now: OR
2Checkout.com is an authorized reseller
of goods provided by Sofmath

Attention: We are currently running a special promotional offer for Algebra-Answer.com visitors -- if you order Algebra Helper by midnight of December 14th you will pay only \$39.99 instead of our regular price of \$74.99 -- this is \$35 in savings ! In order to take advantage of this offer, you need to order by clicking on one of the buttons on the left, not through our regular order page.

If you order now you will also receive 30 minute live session from tutor.com for a 1\$!

You Will Learn Algebra Better - Guaranteed!

Just take a look how incredibly simple Algebra Helper is:

Step 1 : Enter your homework problem in an easy WYSIWYG (What you see is what you get) algebra editor:

Step 2 : Let Algebra Helper solve it:

Step 3 : Ask for an explanation for the steps you don't understand:

Algebra Helper can solve problems in all the following areas:

• simplification of algebraic expressions (operations with polynomials (simplifying, degree, synthetic division...), exponential expressions, fractions and roots (radicals), absolute values)
• factoring and expanding expressions
• finding LCM and GCF
• (simplifying, rationalizing complex denominators...)
• solving linear, quadratic and many other equations and inequalities (including basic logarithmic and exponential equations)
• solving a system of two and three linear equations (including Cramer's rule)
• graphing curves (lines, parabolas, hyperbolas, circles, ellipses, equation and inequality solutions)
• graphing general functions
• operations with functions (composition, inverse, range, domain...)
• simplifying logarithms
• basic geometry and trigonometry (similarity, calculating trig functions, right triangle...)
• arithmetic and other pre-algebra topics (ratios, proportions, measurements...)

ORDER NOW!

 Algebra Helper Download (and optional CD) Only \$39.99 Click to Buy Now: OR
2Checkout.com is an authorized reseller
of goods provided by Sofmath

 "It really helped me with my homework.  I was stuck on some problems and your software walked me step by step through the process..." C. Sievert, KY

 Sofmath 19179 Blanco #105-234San Antonio, TX 78258 Phone: (512) 788-5675Fax: (512) 519-1805
 Home   : :   Features   : :   Demo   : :   FAQ   : :   Order Copyright © 2004-2017, Algebra-Answer.Com.  All rights reserved.