%5. Hodgkin-huxley model of the neuron:
function dnmhVdt=nmhV(t, nmhV)
%nmhV(1)=n;
%nmhV(2)=m;
%nmhV(3)=h;
%nmhV(4)=V;
%dnmhVdt(1)=dndt;
%dnmhVdt(2)=dmdt;
%dnmhVdt(3)=dhdt;
%dnmhVdt(4)=dVdt;
c=1;
gk=36;
gna=120;
gl=0.3;
ek=-72;
ena=55;
el=-49.4;
dnmhVdt=zeros(4, 1);
 
dnmhVdt(1)=(1-nmhV(1))*alphan(nmhV(4))-nmhV(1)*betan(nmhV(4));
dnmhVdt(2)=(1-nmhV(2))*alpham(nmhV(4))-nmhV(2)*betam(nmhV(4));
dnmhVdt(3)=(1-nmhV(3))*alphah(nmhV(4))-nmhV(3)*betah(nmhV(4));
dnmhVdt(4)=(-1/c)*(gk*(nmhV(1)^4)*(nmhV(4)-ek)+gna*(nmhV(2)^3)*nmhV(3)*(nmhV(4)-ena)+gl*(nmhV(4)-el));
end
