% Jon Newman
% 07 April 2010

% This script loads and plots Continuous VC HEKA data

fid = '20100407_2_16.mat';
loc = 'C:\Documents and Settings\Annihilatrix II\Desktop\';
data = load(strcat([loc fid]));
N = 5; % number of plot rows

datid = fieldnames(data);
if length(datid) == 1
    dat = data.(datid{1});
end

time = dat(:,1);
ord = 10e11*dat(:,2);

seglen = floor(length(time)/N);

figure()
for i = 1:N
    subplot(N,1,i)
    x = time((i-1)*seglen+1:i*seglen+1);
    y = ord((i-1)*seglen+1:i*seglen+1);
    plot(x,y,'k');
    ylabel('$I_{mem} (pA)$','Interpreter','latex');
    ylim([-1100 100])
    xlim([min(x) max(x)]);
    if i == 1
        title(fid,'Interpreter','none');
    end
    if i == N
        xlabel('$Time (s)$','Interpreter','latex');
    end
end
