%5. HH solver:
figure,
[t,y]=ode45('nmhV', [0 20], [0.5 0.5 0.5 -60]);
plot(t, y(:,4), 'b');
xlabel('Time (ms)');
ylabel('Transmembrane Voltage (mV)');
title('Approaching Steady State');

figure;
ySS=y(size(y, 1),:);
ySSnew=ySS;
for i=1:10
    ySSnew(1,4)=ySS(1,4)+i;
    [t,y]=ode45('nmhV', [0 20], ySSnew);
    max(y(:,4));
if max(y(:,4))>0
    plot(t, y(:,4), 'r');
else
     plot(t, y(:,4), 'k');
end
hold on;
end
xlabel('Time (ms)');
ylabel('Transmembrane Voltage (mV)');
title('Threshold Behavior');
