Interpreting eigenvalues and eigenvectors when using symbolic toolbox
Mostra commenti meno recenti
When using the symbolic math toolbox (symbolic "d" in this case) I sometimes end up with results (using different stochastic matrices) where I get more eigenvalues returned than eigenvectors which does not make sense to me. Might it be that since the eigenvalues are returned in the same dimension as the input matrix the first eigenvalue in this case 0 is to be ignored. I.e we get three eigenvalues (1, -(d*(3 + 15^(1/2)*1i))/6, (d*(- 3 + 15^(1/2)*1i))/6) corresponding to the three eigenvectors in the example provided below?
Thanks in advance for any input!
Btw I did notice that if I change the symbolic 'd' to a scalar e.g d= 0.5 I get 4 eigenvectors and 4 eigenvalues.
function [eig_mat,eig_val,M] = pagerank_function(linkMatrix,d)
n = size(linkMatrix,1)
M = times(d, linkMatrix) + times((1-d)/n , ones(n))
% diagonal matrix eigenvalues D, eigenvectors mtx U
[U,D] = eig((M))
extract_ev = diag(D)
%x = round(U, 2);
eig_mat = simplify(U)
eig_val = simplify(extract_ev)
end
Where I input the following matrix :
D125 = [0,1/3,1/3,1/3;
0,0,1,0;
1,0,0,0;
0,0,1,0];
And run the function using ;
d = sym('d');
[eig_mat,eig_val,M] = pagerank_function(D125,d);
% Latex code
latex_evtable = latex(sym([eig_mat]))
latex_etable = latex(sym([eig_val]))
latex_matrix = latex(sym(M))
Mtx_maker = latex(sym(D125))
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Linear Algebra in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!











