load('herb21235_11DIV_pre-drug_01.mat')
x1.time = time-max(time);
x1.channel = channel;
x1.threshold = threshold;
x1.unit = unit;

load('herb21235_12DIV_drugs_01.mat')
x2.time = time;
x2.channel = channel;
x2.threshold = threshold;
x2.unit = unit;
load('herb21235_12DIV_drugs_02.mat')
x2.time = [x2.time; time];
x2.channel = [x2.channel; channel];
x2.threshold = [x2.threshold; threshold];
x2.unit = [x2.unit; unit];
load('herb21235_12DIV_drugs_03.mat')
x2.time = [x2.time; time];
x2.channel = [x2.channel; channel];
x2.threshold = [x2.threshold; threshold];
x2.unit = [x2.unit; unit];
frontcut = max(x2.time)-24*3600;
x2.channel = x2.channel(x2.time>frontcut);
x2.threshold = x2.threshold(x2.time>frontcut);
x2.unit = x2.unit(x2.time>frontcut);
x2.time = x2.time(x2.time>frontcut)-frontcut;


load('herb21235_13DIV_drugs_01.mat')
x3.time = time;
x3.channel = channel;
x3.threshold = threshold;
x3.unit = unit;
load('herb21235_13DIV_drugs_02.mat')
x3.time = [x3.time; time];
x3.channel = [x3.channel; channel];
x3.threshold = [x3.threshold; threshold];
x3.unit = [x3.unit; unit];
frontcut = max(x3.time)-24*3600;
x3.channel = x3.channel(x3.time>frontcut);
x3.threshold = x3.threshold(x3.time>frontcut);
x3.unit = x3.unit(x3.time>frontcut);
x3.time = x3.time(x3.time>frontcut)-frontcut+24*3600;

load('herb21235_14DIV_partial-wash4_01.mat')
x4.time = time;
x4.channel = channel;
x4.threshold = threshold;
x4.unit = unit;
frontcut = max(x4.time)-24*3600;
x4.channel = x4.channel(x4.time>frontcut);
x4.threshold = x4.threshold(x4.time>frontcut);
x4.unit = x4.unit(x4.time>frontcut);
x4.time = x4.time(x4.time>frontcut)-frontcut+48*3600;

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('herb21235_11-14DIV.mat','time','channel','unit','threshold','meta');