% % %Solution to Assignment 4, part 2, exercise 3a % %F. Gabbiani 11/21/08 % %Uses 2 additional files: % % lif_fr: to plot the theoretical fI curve % liandfr: to simulate constant current injection % %plot the theoretical fI curve [fr, i_inj] = lif_fr(1,1,111); figure(1); plot(i_inj,fr); %Do simulations using step of 5 nA. i_inj2 = 1:5:111; fr2 = zeros(size(i_inj2)); for i=1:length(i_inj2) [t_vect, v, spk] = liandfr(1000,0.01,i_inj2(i)); fr2(i) = sum(spk); end; hold on; plot(i_inj2,fr2,'or'); xlabel('current (nA)'); ylabel('firing frequency (spk/s)');