clear all;
close all;

subplot(2,1,1); hold off;
subplot(2,1,2); hold off;

load('2013-05-21_hamhock3_03_E-4_OU-Rep-50ms-1.mat')
tmp1 = who('Trace_*');
tmp2 = char(tmp1(1));
uloc = findstr(tmp2,'_');
trace_prefix = tmp2(1:uloc(3));

c = jet(10);

for i = 1:10
    subplot(2,1,1);
    x = eval([trace_prefix num2str(i) '_1']);
    plot(x(:,1),x(:,2)*10^12,'Color',c(i,:));
    hold on;
    
    subplot(2,1,2)
    if i == 10
        load(['hamhock3_cell04_OU-Rep-50ms_VC_01_0' num2str(i) '.mat']);
    else
        load(['hamhock3_cell04_OU-Rep-50ms_VC_01_00' num2str(i) '.mat']);
    end
    plot(x(:,1),dat.raw.Imem*10^12,'Color',c(i,:));
    hold on;
end

subplot(2,1,1);
title('original data');
xlabel('Time (sec)');
ylabel('I_{mem} (pA');
grid on;

subplot(2,1,2);
title('extracted data');
xlabel('Time (sec)');
ylabel('I_{mem} (pA');
grid on;
