For this problem, I think I got most of code correct. However, the correct eigenvector contains the negative values of what I have.
The instructions:
My code:
clear all; close all;
M = [0 1/4 1/4 0 0 0 0 0 0 0;
1/2 0 1/4 1/4 1/6 0 0 0 0 0;
1/2 1/4 0 0 1/6 1/4 0 0 0 0;
0 1/4 0 0 1/6 0 1/2 1/4 0 0;
0 1/4 1/4 1/4 0 1/4 0 1/4 1/4 0;
0 0 1/4 0 1/6 0 0 0 1/4 1/2;
0 0 0 1/4 0 0 0 1/4 0 0;
0 0 0 1/4 1/6 0 1/2 0 1/4 0;
0 0 0 0 1/6 1/4 0 1/4 0 1/2;
0 0 0 0 0 1/4 0 0 1/4 0];
[Y, Z] = eig(M) % pull the first column of T
A8 = Y(:,1) % P
M*A8 % check
save ('A8.dat', 'A8', '-ascii')
I use,
[Y, Z] = eig(M)
to find the associated eigenvalue of 1 in Z with its associated eigenvector from Y. This yields P (or A8) to be:
0.1667
0.3333
0.3333
0.3333
0.5000
0.3333
0.1667
0.3333
0.3333
0.1667
And when I multiply M by P, I get P, which checks out. Apparently the proper values should be negative values of what I got. Can someone clarify?