a1=[30.56	32.72	75.75	37.01	41.99	58.09	100.96	209.16	153.01	408.89];
a2=[26.81	34.18	73.51	35.9	44.44	45.96	69.39	158.46	157.8	295.58];
a3=[19.14	25.08	69.52	13.27	16.18	37.64	59.1	134.97	152.67	272.75];
a4=[19.88	18.49	62.65	22.1	24.49	33.27	98.05	168.24	164.89	335.92];
a5=[64.03	88.1	59.41	102.77	178.14	262.76	203.39	157.89	260.04	277.58];
a6=[5.23	18.42	8.83	4.1	5.8	10.47	11.81	6.75	14.57	15.78]./mel_filt_norm;
a7=[8.18	16.17	6.1	4.71	5.44	9.99	16.13	10.6	15.84	15.09]./mel_filt_norm;
sound_array_a=[a1; a2; a3; a4; a5;a6;a7];

n_a=[];
Rank_table_a=[];
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];
%the for loop to get the normalized data of a and the ranking table of each
%row
for n=1:7
        t=sound_array_a(n,:).*mel_filt_norm;
        n_a=[n_a;t];
        g=n_a(n,:);
        [B,I]=sort(g);
        Rank_table_a=[Rank_table_a;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_a=0;
diff_array_a=[];
diff_table_a=[];
for l=1:6
    m=I_standard(l,:);
    for k=1:7;
        for i=1:10;
            for j= 1:10;
                if Rank_table_a(k,j)==m(i)
                    diff_a=diff_a+(i-j)^2;
                end
            end
        end
        diff_array_a=[diff_array_a diff_a];
        diff_a=0;
    end
    diff_table_a=[diff_table_a;diff_array_a];
    diff_array_a=[];
end