- #1
ver_mathstats
- 260
- 21
Homework Statement
Consider the following vectors, which you can copy and paste directly into Matlab.
x = [2 2 4 6 1 5 5 2 6 2 2];
y = [3 3 3 6 3 6 3 2 3 2];
Use the vectors x and y to create the following matrix.
2 3 0 0 0 0 0 0 0 0 0
3 2 3 0 0 0 0 0 0 0 0
0 3 4 3 0 0 0 0 0 0 0
0 0 3 6 6 0 0 0 0 0 0
0 0 0 6 1 3 0 0 0 0 0
0 0 0 0 3 5 6 0 0 0 0
0 0 0 0 0 6 5 3 0 0 0
0 0 0 0 0 0 3 2 2 0 0
0 0 0 0 0 0 0 2 6 3 0
0 0 0 0 0 0 0 0 3 2 2
0 0 0 0 0 0 0 0 0 2 2
Such a matrix is called a tri-diagonal matrix.
Hint: Use the diag command three times, and then add the resulting matrices.
To check that you have correctly created the matrix A, verify that det(A) = 1.3995e+06.
Find the dominant eigenvalue of A.
2. Homework Equations
The Attempt at a Solution
So I started by copying the matrix into Matlab, so I did a=diag(x) then I did b=diag(y,1), and lastly I did c=diag(y,-1). I added all of my matrices together so d=a+b+c. I get the same matrix on Matlab however my determinant is completely different and I am unsure why?
Thank you.