load('goon21367_14DIV_pre-drug_01.mat')
x1.time = time-max(time);
x1.unit = unit;
x1.channel = channel;
x1.threshold = threshold;
load('goon21367_15DIV_drugs_01.mat')
x2.time = time(time<24*3600);
x2.unit = unit(time<24*3600);
x2.channel = channel(time<24*3600);
x2.threshold = threshold(time<24*3600);
load('goon21367_16DIV_drugs_01.mat')
x3.time = time(time<24*3600)+24*3600;
x3.unit = unit(time<24*3600);
x3.channel = channel(time<24*3600);
x3.threshold = threshold(time<24*3600);
load('goon21367_17DIV_wash4-5_01.mat')
x4.time = time(time<24*3600)+48*3600;
x4.unit = unit(time<24*3600);
x4.channel = channel(time<24*3600);
x4.threshold = threshold(time<24*3600);

clearvars -except x*
time = [x1.time; x2.time; x3.time; x4.time];
channel = [x1.channel; x2.channel; x3.channel; x4.channel];
unit = [x1.unit; x2.unit; x3.unit; x4.unit];
threshold = [x1.threshold; x2.threshold; x3.threshold; x4.threshold];

save goon21367_14-17DIV channel time unit threshold;

clear x*
w(1,:) = [3 4 5 12 13 20 21 28 29];
w(2,:) = [7 14 15 16 22 23 24 30 31];
w(3,:) = [38 39 40 46 47 48 55 56 63];
w(4,:) = [36 37 44 45 52 53 60 61 62];
w(5,:) = [34 35 41 42 43 49 50 51 58];
w(6,:) = [2 9 10 17 18 19 25 26 27];