% This is a simple ode integrator for the HH equations
% it is set up to be easily modified to use for other dynamics
clear all
HH_parameters

Inp = 0;
BCL = 25;

tstep = .1;
t_end = 25;
V = 0;
m=0.0529;
h = 0.5961;
n = 0.3177;

%specify the output points
tspan = [0:tstep:t_end];

s0 = [V;m;h;n];

[T,S] = ode23('deRHS',tspan, s0, odeset('maxstep',1));  
V = S(:,1);
m = S(:,2);
h = S(:,3);
n = S(:,4);


figure(1)
subplot(2,1,1)
plot(T,V)
subplot(2,1,2)
plot(T,m,'b',T,n,'r',T,h,'g')


