Hi, I need to find the eigenvalues and eigenvectors for a square, positive semidefinite matrix where zero is an eigenvalue with geometric multiplicity > 1. I want the first eigenvector to always be the ones vector. Is there a way to do this with the eig or eigs function in MATLAB? If not, does anyone have suggestions on another way?
Here is an example, you can see the ones vector is an eigenvector associated with a zero eigenvalue, but it is not the one MATLAB chooses. Is there a way to force this?
>> G=[2 -1 -1 0 0; -1 2 -1 0 0; -1 -1 3 0 -1; 0 0 0 0 0; 0 0 -1 0 1]>> [v d]=eig(G)v = -0.2206 -0.4487 -0.4082 0.7071 0.2887 -0.2206 -0.4487 -0.4082 -0.7071 0.2887 -0.2206 -0.4487 -0.0000 -0.0000 -0.8660 0.8974 -0.4411 -0.0000 0.0000 0 -0.2206 -0.4487 0.8165 0.0000 0.2887d = -0.0000 0 0 0 0 0 0.0000 0 0 0 0 0 1.0000 0 0 0 0 0 3.0000 0 0 0 0 0 4.0000>> G*ones(5,1)ans = 0 0 0 0 0
Best Answer