% basicSTDP.m
% Principles of Computational Modelling in Neuroscience
% Sterratt, Graham, Gillies, Willshaw
% Cambridge University Press, June 2011
% Fig. 7.13: STDP curve based on spike times
% B. Graham, Computing Science & Maths, University of Stirling
% Contact: b.graham@cs.stir.ac.uk
% Last update: 1-7-2011

tmax=100;
dt=1;
t=0:dt:tmax;

tLTP=20;
wLTP=zeros(1,length(t));
wLTP=0.5*exp(-t/tLTP);

tLTD=40;
wLTD=zeros(1,length(t));
wLTD=0.5*exp(-t/tLTD);

tj=[0 0];
join=[-0.5 0.5];
wj=[-100 100];

tsize=12;
lsize=9;
nsize=9;

plot(t,wLTP,'k-','LineWidth',1);
hold on;
plot(-t,-wLTD,'k-','LineWidth',1);
plot(tj,join,'k-','LineWidth',1);
plot(wj,tj,'k--','LineWidth',1);
xlabel('Post-pre time (ms)','FontSize',lsize,'FontName','Helvetica');
ylabel('Weight change','FontSize',lsize,'FontName','Helvetica');

set(gca,'Box','off');
set(gca,'LineWidth',1);
set(gca,'TickDir','out');
set(gca,'TickLength',[0.02 0.02]);

set(findobj('Type','line'),'LineWidth',1);
set(findobj('Type','text'),'FontSize',nsize,'FontName','Helvetica');

