www.pudn.com > zishiyingjiami.rar > vper.m, change:2011-12-07,size:308b


function C=vper(A,B) 
if size(A)~=size(B) 
    error('wrong size of two input matrix'); 
end 
rows=size(A,1); 
A=reshape(A',1,[]); 
B=reshape(B',1,[]); 
[m1,n1]=size(A); 
[b,ix]=sort(B); 
n=size(B,2); 
C=size(1,n); 
for i=1:n 
    tp=A(i); 
    k1=ix(i); 
    C(k1)=tp; 
end 
C=reshape(C,[],rows); 
C=C';