% Jon Newman
% 07 April 2010

% This script loads and plots continuous CC HEKA data

fid = '20100407_4_21.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 = 1000*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('$V (mV)$','Interpreter','latex');
    xlim([min(x) max(x)]);
    ylim([-60 0])
    if i == 1
        title(fid,'Interpreter','none');
    end
    if i == N
        xlabel('$Time (s)$','Interpreter','latex');
    end
end
