clear all;

ctrl_avg_noNorm = [];
TTX_avg_noNorm = [];
TTXCTZ_avg_noNorm = [];
ctrl_samp_noNorm = [];
TTX_samp_noNorm = [];
TTXCTZ_samp_noNorm = [];
ctrl_cellID = {};
TTX_cellID = {};
TTXCTZ_cellID = {};

dirID = 'C:\Users\mingfaifong\Documents\2012-10-30_juju1-jujuI5372-jujuI5388_patch-analysis\amplitude_30events_NoNorm_01\';
y = dir(dirID); z = [y.isdir];
fidlist = {y(~z).name}';

for i_files = 1:length(fidlist)
    load([dirID fidlist{i_files}]);
    
    fidlist{i_files}
    length(cell_avg{1})
    length(cell_avg{2})
    length(cell_avg{3})
    
    ctrl_avg_noNorm = [ctrl_avg_noNorm, cell_avg{1}/culture_avg(2)];
    TTX_avg_noNorm = [TTX_avg_noNorm, cell_avg{2}/culture_avg(2)];
    TTXCTZ_avg_noNorm = [TTXCTZ_avg_noNorm, cell_avg{3}/culture_avg(2)];

    for i = 1:length(cell_avg{1})
        ctrl_cellID{end+1} = [cultureID{1} '_cell',num2str(i)];
    end
    for i = 1:length(cell_avg{2})
        TTX_cellID{end+1} = [cultureID{2} '_cell',num2str(i)];
    end
    for i = 1:length(cell_avg{3})
        TTXCTZ_cellID{end+1} = [cultureID{3} '_cell',num2str(i)];
    end

    ctrl_samp_noNorm = [ctrl_samp_noNorm; cell_sampdata{1}];
    TTX_samp_noNorm = [TTX_samp_noNorm; cell_sampdata{2}];
    TTXCTZ_samp_noNorm = [TTXCTZ_samp_noNorm; cell_sampdata{3}];
end

save([dirID,'ctrl-TTX-TTXCTZ_normToTTX'],'*_noNorm','*_cellID');