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


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
%**程序名字: 实现两个四元数方阵的乘法 
%**作者:     汪飞 
%**日期:     2005 
%**修改人: 
%**日期: 
%**描述: 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
 
function Output = QuatMuti(uN, vNTC) 
%例如对uN = [1,1,1,1,0,1,1,0;0,0,0,0,1,1,1,1]; 
%和vNTC = [0,0,0,1,1,1,0,0;0,0,0,0,2,2,2,2]; 
%对它们做相乘,得到新的四元数方阵  
 
[a,b] = size(uN); 
%[a2,b2] = size(vNTC); 
 
A = zeros(a,b); 
%if(b>a) 
    for p = 1:a 
        for q = 1:a 
            QRow = ColToRow(vNTC(:,(q-1)*4+1:q*4)); 
            for k = 1:a 
                A(p,(q-1)*4+1:q*4) = A(p,(q-1)*4+1:q*4) + ... 
                    hpc(uN(p,(k-1)*4+1:k*4),QRow((k-1)*4+1:k*4)); 
            end 
        end 
    end 
%end 
 
Output = A;