Post date: May 19, 2016 12:50:41 PM
If you want to compare multiple libraries, you need to load them all at once without overwriting the common variables tnpergene
, readpergene
etc.
Just put all of your .mat file into a given folder and navigate to that folder. Then you can just run the script to load them all into a structure called data:
filelist=dir('*.mat')
filenumber=size(filelist,1);
for ii=1:filenumber
filename=filelist(ii).name
load(filename, 'tnpergene');
load(filename, 'readpergene');
filename=strrep(strrep(strrep(filename,'.mat',''),' ',''),'(Reads)','');
data(ii).tnpergene=tnpergene;
data(ii).readpergene=readpergene;
data(ii).name=filename
end
clear tnpergene readpergene