clear;clc

cd /home/k1514724/subhadip/BBC/analysis/Parcorr_rsfMRI_Netmats/netmats/

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

for l=1:length(files)
    
    connection_matrix(1:90,1:90)=zeros;
    oldfilename=files(l).name
    temp1=load(files(l).name);
    connection_matrix(1:90,1:90)=temp1;
    W_fix=weight_conversion(connection_matrix,'autofix')
    connection_matrix=weight_conversion(W_fix, 'normalize');
    clear temp1; 
    newfilename=strcat('/home/k1514724/subhadip/BBC/analysis/Parcorr_rsfMRI_Netmats/netmats/','fixnormed_',oldfilename);
    save(newfilename,'connection_matrix','-ascii');
    
end