How to use Eigenvector and Eigenvalues of a matrix to formulate Entropy equation?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Amjad Iqbal
le 6 Sep 2022
Commenté : Amjad Iqbal
le 7 Sep 2022
Dear Matlab experts,
I have a matrix T = [T11, T12 ; T21, T22] of size
, where all elements in T are 126*126.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1118440/image.png)
After using this function [Val, Vect] = eig(T); I obtained matrices of Val(
) , and Vect (
digonal).
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1118440/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1118440/image.png)
Now I have eigenvactors and eigenvalues. I need to implement following experssions.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1118430/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1118435/image.png)
I have attached T matrix and crossponding eigenvalues and eigenvectors, I need to estimates both (1) and (2)
Thank you so much.
0 commentaires
Réponse acceptée
Bjorn Gustavsson
le 6 Sep 2022
First you should extract the eigenvalues from the diagonal matrix (mainly for convenience):
vLambda = diag(Vect);
Then you want the sum of the "first two" for your P_i. Presumably "first two" means the two largest, though that's not made explicitly clear. Let's check where those are:
plot(vLambda,'.-')
So the last eigenvalues are the biggest. This gives us for P:
P = vLambda(end-1:end)/vLambda(end) + vLambda(end-1)
Then you're asked for the sum of P multiplied with acos(|u_i|). You should be able to figure that one out. Read the help and documentation of eig and think about what more you know about the eigenvectors (write these facts down in a list) and one fact of those can be used to some insight about acos.
Also since these questions make it seem as you are very new to matlab, I recommend you browse through the on-ramp material. It is designed to get you up and running as fast as possible.
HTH
3 commentaires
Bjorn Gustavsson
le 6 Sep 2022
You can extract an eigenvector in your case like this:
u_1 = Val(:,end);
You can calculate it's norm like this:
n_u_1 = norm(u_1);
and I assume you already know about the acos-function.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Linear Algebra dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!