how i can sorting a name files according a distances in this codes

0
down vote
favorite
i try imagry processing (search indeaxtion) in my Db have obj1__0 obj1__5 files (tjrs multiply by 5 to 355) obj2__0 same tricks … obj100__355.la foction cellstr fact sorts by the alphabet which gives me obj10__0 … .i like order it in name of files obj1__0…obj2__0 obj2__5…obj100__355. and when i sort a second vairiable in ascendant distance,the order of name file atlter according a disatnce.function will returns distances :`

 function s=Similarity()
    [newoutputfil]=Legendre('D:\DB\coil-100\obj1__0.png');
X=load(newoutputfil);
filePattern = fullfile('D:\Projet\Descriptor\LegendreDescriptor', '*.txt');
dataFiles = dir(filePattern);
d=[1,length(dataFiles)];
f={length(dataFiles)};
z=1;
s=cell(2,length(dataFiles));
for k = 1:1:length(dataFiles)
 baseFileName = dataFiles(k).name;%name files
 fullFileName = fullfile('D:\Projet\Descriptor\LegendreDescriptor', baseFileName);
 A = load(fullFileName);
 [m,n]=size(A);
        for i=1:1:n
         for j=1:1:m
             dis=sqrt(sum((X(i,j)-A(i,j))^2));%distance
         end
        end
      d(z)=dis;
      f(z)={char(baseFileName)};%%
      s=[{d},{f}];%%
      z=z+1; 
di=sort(d,'ascend');%%%%
end`