function [m_isis2, cv_isis2] = lif_syn_fig2 t_peak_ex = 1; %in ms g_max_ex = 1; %in nS nsyn_ex = 1000; [t_syn_ex, g_syn_ex] = alpha_syn(t_peak_ex,g_max_ex); v_rev_ex = 70; %reversal potential relative to rest (mV) t_peak_in = 7; %in ms g_max_in = 4; %in nS nsyn_in = 100; [t_syn_in, g_syn_in] = alpha_syn(t_peak_in,g_max_in); v_rev_in = 0; %reversal potential relative to rest (mV) t_max = 1000; t_step = 0.01; %rho_vect_ex = 8:0.5:10; rho_vect_ex = 6:0.5:8; rho_vect_in = 1.0*ones(size(rho_vect_ex)); for i = 1:length(rho_vect_ex) [t_vect,syn_vect_ex] = syn_act(t_max,t_step,rho_vect_ex(i),nsyn_ex); syn_vect_ex2 = conv(syn_vect_ex,g_syn_ex); syn_vect_ex2 = syn_vect_ex2(1:length(t_vect)); %for debugging purposes %syn_vect_ex2 = zeros(size(syn_vect_ex2)); [t_vect,syn_vect_in] = syn_act(t_max,t_step,rho_vect_in(i),nsyn_in); syn_vect_in2 = conv(syn_vect_in,g_syn_in); syn_vect_in2 = syn_vect_in2(1:length(t_vect)); [v_lif, spk_lif] = liandfr4(t_vect,syn_vect_ex2, v_rev_ex, syn_vect_in2, v_rev_in); %show the conductances and vm trajectory mean figure; subplot(2,1,1); h1 = plot(t_vect,syn_vect_ex2); hold on; h2 = plot(t_vect,syn_vect_in2,'r'); legend([h1 h2],{'excitation', 'inhibition'}); ylabel('conductance (nS)'); subplot(2,1,2); h3 = plot(t_vect,v_lif); legend(h3,'LIF Vm'); xlabel('time (ms)'); ylabel('Vm (mV)'); t_spks2 = t_vect(find(spk_lif>0.5)); isis2 = t_spks2(2:end) - t_spks2(1:end-1); m_isis2(i) = mean(isis2); s_isis2(i) = std(isis2); cv_isis2(i) = s_isis2/m_isis2; end;