close all;
clear all;
resting = [0.3177    0.0529    0.5962  -59.9995];
ySS = resting;
ySS(4) = -52;
[t,x]=ode45('hhode',[0 10],ySS);
if max(x(:,4))>0 && max(x(:,4))<50
    plot(t, x(:,4),'r')
    drawnow;
    hold on;
    

elseif max(x(:,4))>50
    plot(t, x(:,4),'b')
    drawnow;
    hold on;
    
else
    plot(t, x(:,4),'k')
    drawnow;
    hold on;
    
end

title('Threshold Behavior');
xlabel('Time (ms)');
ylabel('Transmembrane Voltage (mV)');

figure;
plot(t, x(:,3),'r')
hold on
plot(t, x(:,2),'y')
plot(t, x(:,1),'b')
legend('h','m','n');


