function xdot=Gmlfun(t,x); % Called function for GMorris_Lecar.m % Note that all parameters are set in the calling program % Carol Lucas global Vk Vl Vca gca gk gl V1 V2 V3 V4 c phi tend Vinit Winit I V=x(1,1); W=x(2,1); minf=.5*(1+tanh((V-V1)/V2)); winf=.5*(1+tanh((V-V3)/V4)); tauw=1/cosh((V-V3)/(2*V4)); xdot(1,1) = ( I - gca*minf*(V-Vca)-gk*W*(V-Vk)-gl*(V-Vl))/c; xdot(2,1)= phi*(winf-W)/tauw;