for i = 1:100
x = who(['Trace_3_4_' num2str(i) '_*']); %x = who('Trace_3_6_2_*');
if length(num2str(i))==1
    dat.meta.name = ['ollie3_cell03_04_PowSteps_00' num2str(i)];
elseif length(num2str(i))==2
    dat.meta.name = ['ollie3_cell03_04_PowSteps_0' num2str(i)];
elseif length(num2str(i))==3
    dat.meta.name = ['ollie3_cell03_04_PowSteps_' num2str(i)];
end    
dat.meta.sweepNum = i;
dat.meta.sweepLengthSec = 1;
dat.meta.wasSweep = 1;
dat.meta.protocolType = 'PowSteps';


x_Imem = eval(char(x(1)));
x_Vmem = eval(char(x(2)));
x_Iled = eval(char(x(3)));
x_Vpd = eval(char(x(4)));

dat.meta.fs_hz = 1/mean(diff(x_Imem(:,1)));
dat.meta.units.Imem = 'A';
dat.meta.units.Vmem = 'V';
dat.meta.units.Vled = 'V';
dat.meta.units.Iled = 'A';
dat.meta.units.Ipd = 'A';

dat.raw.Imem = x_Imem(:,2);
dat.raw.Vmem = x_Vmem(:,2);
dat.raw.Vctl = [];
dat.raw.Iled = x_Iled(:,2);
dat.raw.Vpd = x_Vpd(:,2);
save([dat.meta.name '.mat'],'dat');

dat.raw.Imem = x_Imem;
dat.raw.Vmem = x_Vmem;
dat.raw.Vctl = [];
dat.raw.Iled = x_Iled;
dat.raw.Vpd = x_Vpd;
dat.meta.name = [dat.meta.name 't'];
save([dat.meta.name '.mat'],'dat');

end