www.pudn.com > zishiyingjiami.rar > LTR.m, change:2011-12-09,size:456b


function A5=LTR(A) 
[m,n]=size(A); 
bm1=1;em1=m/2;bm2=m/2+1;em2=m;bn1=1;en1=n/2;bn2=n/2+1;en2=n; 
%左对右重构 
A1(:,bn1:en1)=A(:,bn1:en1);           %左半部分 
A2(:,bn1:en1)=A(:,bn2:en2);           %右半部分 
A3=per(A2,A1);                        %用A1置乱A2 
A4=bitxor(A3,A1); 
for i=1:m 
    for j=1:n 
        if j<=n/2 
            A5(i,j)=A1(i,j);          %左半部分不变 
        else 
            A5(i,j)=A4(i,j-n/2);       
        end 
    end 
end