mel_filt_norm = [1/5.5, 1/6, 1/6.5, 1/8, 1/9.5, 1/10.5, 1/12, 1/14, 1/16, 1/18.5];
r1=[87.73	119.4	221.2	238	101.06	99.59	115.12	149.55	190.76	295.59];
r2=[14.44	24.33	47.32	83.28	87.58	27.58	49.34	31.85	49.32	53.49];
r3=[21.1	32.25	82.52	127.75	96.97	36.9	28.52	43.87	86.55	169.95];
r4=[22.08	35.96	68.69	159.16	134.75	34.28	44.3	44.02	81.11	111.08];
r5=[19.57	33.55	166.83	88.92	95.72	44.47	45.17	52.4	125.45	224.8];
sound_array_r=[r1; r2; r3; r4; r5];
n_r=[];
Rank_table_r=[];
%the for loop to get the normalized data of e and the ranking table of each
%row
for n=1:5
        t=sound_array_r(n,:).*mel_filt_norm;
        n_r=[n_r;t];
        g=n_r(n,:);
        [B,I]=sort(g);
        Rank_table_r=[Rank_table_r;I];
end

%the standard array
I_a=[4 5 1 2 6 7 9 3 8 10];
I_e=[1 3 2 7 4 6 8 5 9 10];
I_r=[8 6 7 1 9 2 10 5 3 4];
I_i=[1 8 7 2 9 10 3 6 5 4];
I_o=[7 8 1 4 6 9 2 5 10 3];
I_l=[1 4 5 6 8 7 9 2 3 10];
I_standard=[I_a;I_e;I_i;I_o;I_l;I_r];
%try to compute the square root of the different data;
%seems to be reliable now.
diff_r=0;
diff_array_r=[];
diff_table_r=[];
for l=1:6
    m=I_standard(l,:);
    for k=1:5;
        for i=1:10;
            for j= 1:10;
                if Rank_table_r(k,j)==m(i)
                    diff_r=diff_r+(i-j)^2;
                end
            end
        end
        diff_array_r=[diff_array_r diff_r];
        diff_r=0;
    end
    diff_table_r=[diff_table_r;diff_array_r];
    diff_array_r=[];
end