n = 26;

best_vaf = 0.0;
store_vaf = zeros(100,1); 
load mandm_sphere_data.dat

for i = 1:100
    
    [find,vaf,outperm,addcon,coord] = ms_uniscalac(mandm_sphere_data, randperm(n),25);
    

    
    store_vaf(i) = vaf;
    
    if (vaf > best_vaf)
        
        best_vaf = vaf;
        best_find = find;
        best_outperm = outperm;
        best_addcon = addcon;
        best_coord = coord;
        
        
    end
end

sorted_vafs = sort(store_vaf');

sorted_vafs

best_vaf

best_find

best_outperm

best_addcon

best_coord



best_vaf = 0.0;
store_vaf = zeros(100,1);

for i = 1:100
    
    [outpermone,outpermtwo,coordone,coordtwo,fitone,fittwo,addconone,addcontwo,vaf] ...
        = ms_biscalqa(mandm_sphere_data,targlin(26),targlin(26),randperm(n),randperm(n),25,1);
    

    
    store_vaf(i) = vaf;
    
    if (vaf > best_vaf)
        
        best_vaf = vaf;
        
      
        
        
        best_outpermone = outpermone;
        best_outpermtwo = outpermtwo;
        best_addconone = addconone;
        best_addcontwo = addcontwo;
        best_coordone = coordone;
        best_coordtwo = coordtwo;
        
        
        
    end
end

sorted_vafs = sort(store_vaf');

sorted_vafs

best_vaf

best_outpermone
best_outpermtwo
best_addconone
best_addcontwo
