Effacer les filtres
Effacer les filtres

Measure the coherence (or incoherence) of two/one matrix/ces

7 vues (au cours des 30 derniers jours)
Alex
Alex le 9 Fév 2012
Dear all I would like to ask you if there is in matlab a fuction that based on two/one input matrices to calculate the coherence or incoherence between those two or the mutual coherence of itself.
I would like to thank you in advance for your help
Regards Alex

Réponses (2)

Wayne King
Wayne King le 9 Fév 2012
For a single matrix, X, compute
X'*X
and then find the largest absolute value not on the main diagonal.
X = randn(4,4);
X = X/(diag(sqrt(diag(X'*X))));
mcoh = abs(X'*X);
V = diag(mcoh);
V = -diag(V,0);
mcoh = mcoh+V;
max(max(mcoh))
You want to normalize the column vectors in X to have unit norm first.
  1 commentaire
SUMIT
SUMIT le 16 Déc 2013
how can i calculate coherence between two matrices??

Connectez-vous pour commenter.


Pushkar Khatri
Pushkar Khatri le 30 Mai 2018
For the mutual coherence of a single matrix, you can make your own function and implement it later in command line. Here is my function(I had used the convention X*X' for my purpose, you can use change it to X'*X) :-
function z = mutual_coherence(X)
[m,n] = size(X);
for i =1:m
d1 = norm(X(i,:));
for j =1:m
d2 = norm(X(j,:));
if i ==j
continue;
else
z = max((sqrt((X(i,:)*X(j,:)')^2 ))/(d1*d2));
end
end
end
end
  2 commentaires
Kobi
Kobi le 13 Avr 2019
about your function
what if the number of rows is different then the number of columns?
n is unused.
Pushkar Khatri
Pushkar Khatri le 13 Avr 2019
Modifié(e) : Pushkar Khatri le 13 Avr 2019
As per the function, it finds out the mutual coherence of a single matrix X. So for that you need to find the matrix multiplication of X with its transpose. In my function number of rows and columns are different. if you do X * X' , you'll get m by m matrix and if you do X' * X you'll get n by n matrix. The point is not to loose the importanat information. So if m>n, find coherence using rows(i.e m) { in this way, you get coherence for m*n elements and rest of the elements out of total m*m elements will be zero },
else if n>m , use n instead of m in the function.
Does that clear your doubt?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Accelerators & Beams 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!

Translated by