25 lines
387 B
Matlab
25 lines
387 B
Matlab
function [mc_val] = cal_mutual_coherence(dic_mat, plot_flag)
|
|
|
|
[~, N] = size(dic_mat);
|
|
|
|
for idx = 1 : N
|
|
for jdx = 1 : N
|
|
if idx ~= jdx
|
|
mc(idx, jdx) = abs(dic_mat(:, idx)' * dic_mat(:, jdx)) / norm(dic_mat(:, idx))^2;
|
|
else
|
|
mc(idx, jdx) = 0;
|
|
end
|
|
end
|
|
end
|
|
|
|
if plot_flag == 1
|
|
figure
|
|
imagesc(mc)
|
|
end
|
|
|
|
mc_val = max(max(mc));
|
|
|
|
|
|
end
|
|
|