function [t,y]=fzhn %esto genera una corrida del modelo de Fitzhugh- Nagumo %------------- default values -------------- global a b c ton toff Ampl; Ampl=-0.128 a=0.7 b=0.8 c=3. %------------- time period------------- tspan = [0; 30]; %--------------- Pulso ---------------- ton=100 toff=110 %--------- V - y(1) W - y(2) X - y(3) C - y(4) %------------- initial values------------- %y0=[ 8.2540 ; 0.7356 ; 0.2221 ; 0.1563];%middle of a middle spike y0=[ 1; -0.5]; [t,y] = ode45(@f,tspan,y0); derivs=[]; size(y,1) for j=1:(size(y,1)) derivs=[derivs; f(t(j),y(j,:))']; end %----------------ODEs-------------------- %---------------equations (1), (8) but 1/tau, (14), (17)------------------- function dydt = f(t,y) global ton toff a b c Ampl; dydt=zeros(2,1); dydt(1) = c*(Ampl + y(2)+y(1)-(1./3.)*y(1)^3); dydt(2) = -1.* (y(1)-a+b*y(2))/c ; %----------------equation (10), but 1/tau----------------------------- function Itot1 = Itot(xa,ya) Itot1= ya+xa-(1/3)*xa.^3 function Iap_t=Iapp(x) global ton toff Ampl; if x>ton && x