clear;clc;

cd /home/subhadip/Autism_AnatNet/austistic_study/Diffusion_Analysis/90_regions

chk=dir('connection_matrix_*.txt')

matrix(1:length(chk),1:length(chk),1:length(chk))=zeros;

for l=1:length(chk)
matrix(1:90,1:90,l)=load(chk(l).name);

end

cv_value(1:length(chk),1:length(chk))=zeros;

for i=2:length(chk)
    for j=i+1:length(chk)
        
    mean_value=mean(2*matrix(i,j,:));
    std_value=std(2*matrix(i,j,:));
    
    cv_value(i,j)=std_value/mean_value;
    
    end
    new_matrix=(cv_value+transpose(cv_value))*100;
end

save('/home/subhadip/Autism_AnatNet/austistic_study/Diffusion_Analysis/90_regions/CV_network_connections.txt','new_matrix','-ascii')