www.pudn.com > Quaternions-MUSIC.rar > IsoMatrix.m, change:2012-12-03,size:981b


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
%**程序名字: 四元数矩阵的同构复矩阵 
%**作者:     汪飞 
%**日期:     2005-1-13 
%**修改人: 
%**日期: 
%**描述:     Isomatrix of Quaternion Matrix,which was assigned as  
%             (0,0) (0,1) ...(0,W-1);(1,0) (1,1) ...(1,W-1);...;(H-1,0)  
%             (H-1,1) ...(0,W-1) 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
 
 
function Output = IsoMatrix(QM) 
%QM = [1,2,2,3;2,1,3,3;2,1,3,2]; 
 
[a,b] = size(QM); 
 
u = 0; 
S_C_Q = zeros(2*a, b/2); 
for p = 1:a 
   m = 2*u+1; 
   u = u+1; 
   v = 0; 
   for j = 1:4:b 
      % 得到每一个四元数对应的同构复数 
      C_Q = [QM(p,j)+QM(p,j+1)*1i,QM(p,j+2)+QM(p,j+3)*1i; 
         -QM(p,j+2)+QM(p,j+3)*1i,QM(p,j)-QM(p,j+1)*1i]; 
      n = 2*v+1; 
      v = v+1; 
      % 将每一个四元数对应的四个复数放在对应的四元数矩阵的位置上 
      S_C_Q(m,n:n+1)= C_Q(1,:); 
      S_C_Q(m+1,n:n+1) = C_Q(2,:); 
   end 
end 
 
Output = S_C_Q;