dirID = 'C:\Users\USER\Documents\mingfaifong\2013-01-30_vivy_MEA-analysis\';
fid = 'vivy21367_10DIV_nodrug_02';
x1 = load([dirID fid]);

fid = 'vivy21367_11DIV_drugs_02';
x2 = load([dirID fid]);

fid = 'vivy21367_12DIV_wash4_01';
x3 = load([dirID fid]);

%time = [x1.time-max(x1.time); x2.time; x3.time+max(x2.time)];
time = [x1.time-max(x1.time); x2.time(x2.time<24*3600); x3.time+24*3600];
channel = [x1.channel; x2.channel(x2.time<24*3600); x3.channel];
%unit = [x1.unit; x2.unit; x3.unit];
threshold = [x1.threshold; x2.threshold(x2.time<24*3600); x3.threshold];
%waveform = [x1.waveform x2.waveform x3.waveform];

%save([dirID 'vivy21367_10-12DIV.mat'],'time','channel','unit','threshold');
save([dirID 'vivy21367_10-12DIV.mat'],'time','channel','threshold');