fid = 'test-prot-1';
dt = 10;
v = [1:0.5:4.5 0];
N = length(v);
t = dt*(0:N-1);%N;
c = ones(size(t));

makeauxfile(fid,t',c',v');

t = (dt/2)*(0:2*(N-1));
p = mod(1:length(t),2);
t = t(1:end-1);
p = p(1:end-1);


makedigfile(fid,p',t');


%% Plot the results (collected on paper)
a_bundle = 141.4474;
a_lens = 246.6138;
a_homemade = 17.34;
A = [1.1 1.0 0.87 0.68 0.49 0.3 0.11];
P_lens = [82 77 68 56 43 27 10.8]/a_bundle;
P_nolens = [51 48 44 37 28 19 8.2]/a_bundle;
P_nolt = [190 174 160 129 95 60 23.9]/a_lens;
P_homemade = [5.8 5.2 4.7 3.5 2.7 1.8 0.74]/a_homemade;
P = [P_nolens' P_lens' P_nolt' P_homemade'];

figure();
plot(A,P);
xlabel('I_{LED} (A)')
ylabel('Power @ P.D. (mW/mm^2)')
legend('Bundle w/o lens',  'Bundle w/ lens', 'Lens alone','Homemade Bundle','Location','NorthWest')

