clear; clc; 

cd /home/subhadip/Autism_AnatNet/austistic_study/Diffusion_Analysis/90_regions/aHU0879.bedpostX

files=dir('region*.txt');

matrix(1:length(files):1:length(files))=zeros;

for l=1:length(files)
    
chk=load(files(l).name);
matrix(l,:)=sum(chk);
matrix(l,l)=0;
end

asym_connection_matrix=(matrix);

sym_connection_matrix=(matrix+transpose(matrix));

save('/home/subhadip/Autism_AnatNet/austistic_study/Diffusion_Analysis/90_regions/adj_matrixes/NOS_weighted/asymmetric/connection_matrix_asym_aHU0879.txt','asym_connection_matrix','-ascii');
save('/home/subhadip/Autism_AnatNet/austistic_study/Diffusion_Analysis/90_regions/adj_matrixes/NOS_weighted/symmetric/connection_matrix_sym_aHU0879.txt','sym_connection_matrix','-ascii');
