www.pudn.com > Patternrecognition.rar > bubbling.m, change:2009-07-01,size:564b


function [orderedListIndex]=bubbling(TargetList) 
[c length]=size(TargetList); 
orderedListIndex=zeros(1,length); 
for i=1:length 
    orderedListIndex(1,i)=i; 
end; 
for i=1:length 
    for j=i:length 
        if(TargetList(i)<TargetList(j)) 
            TargetListtemp=TargetList(i); 
            TargetList(i)=TargetList(j); 
            TargetList(j)=TargetListtemp; 
            orderedListIndextemp=orderedListIndex(i); 
            orderedListIndex(i)=orderedListIndex(j); 
            orderedListIndex(j)=orderedListIndextemp; 
        end; 
    end; 
end;