demo1.m

来自「盲源分离中的J.F.Cardoso的对角化matlab源程序」· M 代码 · 共 41 行

M
41
字号
% Calling  the joint approximate diagonalization function.

m=5   % dimension
n=3   % number of matrices



seuil	= 1.0e-12; % precision on joint diag 

compteur=0;


while 1 ; compteur=compteur+1;


% drawing a `random' unitary matrix
U= randn(m)+i*randn(m) ; [U,to_waste]=eig(U+U'); 

% Drawing a random set of commuting matrices
A=zeros(m,m*n);
for imat=1:n
  cols		= 1+(imat-1)*m:imat*m;
  A(:,cols)	= U*diag(randn(m,1)+i*randn(m,1))*U';
end;


% Perturbation of the joint structure ?
% A = A + 0.001*randn(m,m*n);


%% Do it
[ V , DD ] = joint_diag(A,seuil);

%% should be permutation matrix 
abs(V'*U)



end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?