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

조회 수: 3 (최근 30일)
Alex
Alex 2012년 2월 9일
편집: Pushkar Khatri 2019년 4월 13일
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

답변 (2개)

Wayne King
Wayne King 2012년 2월 9일
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
SUMIT
SUMIT 2013년 12월 16일
how can i calculate coherence between two matrices??

댓글을 달려면 로그인하십시오.


Pushkar Khatri
Pushkar Khatri 2018년 5월 30일
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
Kobi
Kobi 2019년 4월 13일
about your function
what if the number of rows is different then the number of columns?
n is unused.
Pushkar Khatri
Pushkar Khatri 2019년 4월 13일
편집: Pushkar Khatri 2019년 4월 13일
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?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by