load miniDB;

%% decay histogram

clear prebic buster359 ind*

ind_prebic = strfind(fid,'pre');
for i = 1:length(ind_prebic)
    if isempty(ind_prebic{i})
        ind_prebic{i} = [0];
    end
end
ind_prebic = logical(cell2mat(ind_prebic));
prebic.decay = decay(ind_prebic);
prebic.decay = prebic.decay(prebic.decay>0.25)

% prebic.decay = decay(strmatch('TTX',bath));

ind_buster359 = strfind(fid,'buster359');
for i = 1:length(ind_buster359)
    if isempty(ind_buster359{i})
        ind_buster359{i} = [0];
    end
end
ind_buster359 = logical(cell2mat(ind_buster359));
buster359.decay = decay(ind_buster359);

bins = 0:0.5:40;
prebic.hist = histc(prebic.decay,bins);
buster359.hist = histc(buster359.decay,bins);

%%
subplot(2,1,1)
hold off;
bar(bins+0.25,prebic.hist);
xlim([0 25]);
subplot(2,1,2)
hold off;
bar(bins+0.25,buster359.hist);
xlim([0 25]);