clear all;

rpath='../../result/artdata/';

snum=4;

N=5;

for ii=1:3
    if(ii==1)
        method='ICA';
    elseif(ii==2)
        method='TICA';
    else
        method='CTA';
    end
    
    for jj=1:snum
        Aind=zeros(N,1);
        Tind=zeros(N,1);

        for tt=1:N
            fname=[rpath method '/case' num2str(jj) 'source' method num2str(tt) '.mat'];            
            load(fname);
            
            P=W*whiteningMatrix*A;

            Aind(tt)=compute_Amariindex(P);
            Tind(tt)=compute_Tindex(P);
        end
            sfname=[rpath 'index/case' num2str(jj) 'source' method 'index_result.mat'];            
            save(sfname,'Aind','Tind');
    end
end