figure;

%filenames = {'orion360','orion363'};
bins = 0:0.5:50;

clear subset;
% subset.amplitude = amplitude(strmatch('control',treatment));
% subset.area = area(strmatch('control',treatment));
% subset.bath = bath(strmatch('control',treatment));
% subset.culture = culture(strmatch('control',treatment));
% subset.decay = decay(strmatch('control',treatment));
% subset.div = div(strmatch('control',treatment));
% subset.fid = fid(strmatch('control',treatment));
% subset.rise = rise(strmatch('control',treatment));
% subset.time = time(strmatch('control',treatment));
% subset.treatment = treatment(strmatch('control',treatment));

subset.amplitude = amplitude;
subset.area = area;
subset.bath = bath;
subset.culture = culture;
subset.decay = decay;
subset.div = div;
subset.fid = fid;
subset.rise = rise;
subset.time = time;
subset.treatment = treatment;



subset2.amplitude = subset.amplitude(strmatch('bicuculline',subset.bath));
subset2.area = subset.area(strmatch('bicuculline',subset.bath));
subset2.bath = subset.bath(strmatch('bicuculline',subset.bath));
subset2.culture = subset.culture(strmatch('bicuculline',subset.bath));
subset2.decay = subset.decay(strmatch('bicuculline',subset.bath));
subset2.div = subset.div(strmatch('bicuculline',subset.bath));
subset2.fid = subset.fid(strmatch('bicuculline',subset.bath));
subset2.rise = subset.rise(strmatch('bicuculline',subset.bath));
subset2.time = subset.time(strmatch('bicuculline',subset.bath));
subset2.treatment = subset.treatment(strmatch('bicuculline',subset.bath));

subset1.amplitude = subset.amplitude(strmatch('TTX',subset.bath));
subset1.area = subset.area(strmatch('TTX',subset.bath));
subset1.bath = subset.bath(strmatch('TTX',subset.bath));
subset1.culture = subset.culture(strmatch('TTX',subset.bath));
subset1.decay = subset.decay(strmatch('TTX',subset.bath));
subset1.div = subset.div(strmatch('TTX',subset.bath));
subset1.fid = subset.fid(strmatch('TTX',subset.bath));
subset1.rise = subset.rise(strmatch('TTX',subset.bath));
subset1.time = subset.time(strmatch('TTX',subset.bath));
subset1.treatment = subset.treatment(strmatch('TTX',subset.bath));


x = hist(subset1.decay,bins);
y = hist(subset2.decay,bins);

hold off;
subplot(2,2,1)
bar(bins,x/sum(x));
hold on;
subplot(2,2,2)
bar(bins,[y(1)/2,y(2:end)]/sum(y));
subplot(2,2,3:4)
bar(bins,x/sum(x)); hold on;
bar(bins,[y(1)/2,y(2:end)]/sum(y));
