% load('tommy1_celldata.mat')

f_col = 3; %amplitude
f_col = 19; %frequency
% f_col = 5; %decay
% f_col = 6; %charge

pre = [];
ctz_0to2hr = [];
ctz_2to4hr = [];
ctz_4to6hr = [];
ctz_10to12hr = [];

pre(end+1) = nanmean(tommy1_cell06(:,f_col));
pre(end+1) = nanmean(tommy1_cell07(:,f_col));
pre(end+1) = nanmean(tommy1_cell09(:,f_col));
pre(end+1) = nanmean(tommy1_cell10_pre(:,f_col));
pre(end+1) = nanmean(tommy1_cell05(:,f_col));

ctz_0to2hr(end+1) = nanmean(tommy1_cell11(:,f_col));
ctz_0to2hr(end+1) = nanmean(tommy1_cell12(:,f_col));
ctz_0to2hr(end+1) = nanmean(tommy1_cell13((isfinite(tommy1_cell13(:,f_col))),f_col));

ctz_2to4hr(end+1) = nanmean(tommy1_cell14(:,f_col));
ctz_2to4hr(end+1) = nanmean(tommy1_cell15(:,f_col));

ctz_4to6hr(end+1) = nanmean(tommy1_cell16((isfinite(tommy1_cell16(:,f_col))),f_col));
ctz_4to6hr(end+1) = nanmean(tommy1_cell17(:,f_col));
ctz_4to6hr(end+1) = nanmean(tommy1_cell18(:,f_col));

ctz_10to12hr(end+1) = nanmean(tommy1_cell19(:,f_col));
ctz_10to12hr(end+1) = nanmean(tommy1_cell20(:,f_col));
ctz_10to12hr(end+1) = nanmean(tommy1_cell21(:,f_col));

avg.pre = mean(pre);
stderr.pre = std(pre)/sqrt(length(pre));
avg.ctz_0to2hr = mean(ctz_0to2hr);
stderr.ctz_0to2hr = std(ctz_0to2hr)/sqrt(length(ctz_0to2hr));
avg.ctz_2to4hr = mean(ctz_2to4hr);
stderr.ctz_2to4hr = std(ctz_2to4hr)/sqrt(length(ctz_2to4hr));
avg.ctz_4to6hr = mean(ctz_4to6hr);
stderr.ctz_4to6hr = std(ctz_4to6hr)/sqrt(length(ctz_4to6hr));
avg.ctz_10to12hr = mean(ctz_10to12hr);
stderr.ctz_10to12hr = std(ctz_10to12hr)/sqrt(length(ctz_10to12hr));

barweb([avg.pre,avg.ctz_0to2hr,avg.ctz_2to4hr,avg.ctz_4to6hr,avg.ctz_10to12hr],...
    [stderr.pre,stderr.ctz_0to2hr,stderr.ctz_2to4hr,stderr.ctz_4to6hr,stderr.ctz_10to12hr],...
    0.8);

set(gca,'TickLength',[0.01 0.025],'TickDir','out')

% ttest2(pre,ctz_0to2hr)