University of British ColumbiaMATH LINEAR ALG 221 MATLAB ASSIGNMENT 5 This assignment comes with a file Ex5Data.mat. Import this file as you did in Exercise 1—refer to Exercise 1 ifyou can’t remember how.This assignment concerns eigenvalues and eigenvectors of a square matrix.DETERMINANTSIf A is a square matrix, then>> det(A)will calculate the determinant of A.EIGENVECTORSThe code>> e = eig(A)
...[Show More]
University of British ColumbiaMATH LINEAR ALG 221 MATLAB ASSIGNMENT 5
This assignment comes with a file Ex5Data.mat. Import this file as you did in Exercise 1—refer to Exercise 1 if
you can’t remember how.
This assignment concerns eigenvalues and eigenvectors of a square matrix.
DETERMINANTS
If A is a square matrix, then
>> det(A)
will calculate the determinant of A.
EIGENVECTORS
The code
>> e = eig(A)
stores in e a column vector containing the eigenvalues of square matrix A. If ‚ is a root of the characteristic polynomial multiple times, it will appear more than once in this vector.
The code
>> [V,D] = eig(A)
stores in D a diagonal matrix of eigenvalues and in V a matrix whose columns are corresponding eigenvectors.
Another useful command is
>> null(A)
which produces a basis for the null space of a matrix A. You may prefer to use
>> null(A, ’r’)
which does not scale the basis vectors to have length 1, and therefore gives more pleasant answers.
Determinants and Eigenvalues. If A is an n £n matrix, then let pA(x) denote the characteristic polynomial of A.
We can factor pA(x) as
pA(x) ˘ det(A ¡ xIn) ˘ (¡1)n(x ¡‚1)(x ¡‚2)...(x ¡‚n)
where the ‚i are the eigenvalues of A. The sign (¡1)n in the front is ¯1 if n is even and ¡1 if n is odd. Note that
there are n eigenvalues here, and it is possible that some eigenvalues appear more than once, i.e., they appear with
algebraic multiplicity.
We can interpret pa(0) in two different ways. First
pA(0) ˘ det(A ¡0In) ˘ det A.
and second
pA(0) is the constant term of (¡1)n(x ¡‚1)(x ¡‚2)...(x ¡‚n)
which is to say
pA(0) ˘ (¡1)n(¡1)(¡‚2)...(¡‚n) ˘ (¡1)n(¡1)n‚1‚2 ...‚n ˘ ‚1‚2 ...‚n.
We have proved: If A is an n £ n matrix, then det(A) is equal to the product of all eigenvalues of A, counted with
multiplicities.
For example, there is a matrix P in the data file. Determine its eigenvalues by
>> eig(P)
The answer should be a list of integers. Then calculate
>> det(P)
and note that it is a product of the integers you found previously
[Show Less]