This is my first post. I'm sorry I don't have mathjax. I'm working through some linear algebra problems, and I keep running into situations where $[(\lambda I-A)]$ (where $A$ is a matrix, $\lambda$ is an eigenvalue and $I$ is the identity matrix) reduces to the identity matrix BUT matlab manages to give an eigenvector from these values. Below is an example. Singular value decomposition of $A$
A = [ 1 -1 2; 3 2 0; 1 -3 4]
R = A*A'
det(R)
%non-zero
rref([R eye(3)])
rref(R)
[V,L] = eigs(R)
% returns eigenvalues on the diagonal of $L$ and eigenvectors as the rows of $V$ The eigen vectors are normalized (unit vectors)
Here is what the program returns
A =
1 -1 2
3 2 0
1 -3 4
ans =
1 3 1
-1 2 -3
2 0 4
R =
6 1 12
1 13 -3
12 -3 26
%det(R) not equal to 0
det(R) = 4.0000
%three eigenvectors
V =
0.4134 0.2032 -0.8876
-0.1214 0.9784 0.1674
0.9024 0.0385 0.4291
%L gives the three eigenvalues on the diagonal
% first and third eigenvalues that when plugged into [lambda*I - R] rref to identity
%see below for example of [lambda*I-R]
L =
31.9008 0 0
0 13.0896 0
0 0 0.0096
%rref(eigenvalue1*I - R)
ans =
1 0 0
0 1 0
0 0 1
When I work the problem by hand I get the same thing.
Please help I have an exam tomorrow and I feel stuck. On one occasion, I was following the professor by punching the numbers into matlab and he reduced a matrix to $$\begin{pmatrix} 1 & 0 & 1 \\ 0 & 1 & 0 \\ 0 & 0 & 0 \\ \end{pmatrix}$$ but I got identity in matlab. Matlab matched his eigenvectors. I then reworked by hand after class following elementary row operations and I got the identity matrix. I'm open to any suggestions.
Maybe my question boils down to is there another way to put a matrix into rref without getting the identity matrix? That seems contradictory. I'm missing something between $\lambda I-R$ and the eigenvectors.
-Scott
Your intuition in the comment is correct, this is a precision problem, specifically on the eigenvalues (and also that this is more of a Matlab question than a math question).
Nevertheless, the answer to your question is yes, there is another way to input matrices into rref if you have the Symbolic Math Toolbox. This toolbox lets you perform calculations symbolically, and evaluate expressions to arbitrary precision at any point.
Here are the calculations performed symbolically:
Note that the imaginary components of the final result are smaller than $10^{-100}$, and should be disregarded since precision was set to $100$ digits. If we had set the variable precision to $1000$ digits, the imaginary components would be smaller than $10^{-1000}$.
As a minor footnote, although it had no impact on your calculations,
eigs()is intended to return a subset of eigenvalues for sporatic matrices. For non-sporatic matrices, you should useeig().