% GHodgkin_Huxley % Carol Lucas % Simulates the Hodgkin_Huxley Model. Can be used to get figures like 2.13 global VNa VK VL gNa gK gL C Iapp Vinit minit hinit ninit tend clear t; R=input('Hit any number to erase figures: '); if length(R)~=0; figure(1);clf;figure(2);clf;figure(3);clf; end tstart=0; k=1;t=[tstart:.25:tend]; xint=[Vinit;minit;hinit;ninit]; [t,x]=ode45('Ghhfun',t,xint); figure(1);plot(t,x(:,1));axis([0 tend -80 60]); xlabel('time (ms)'),ylabel('voltage (mv)');hold on; figure(2);subplot(221);plot(t,x(:,2)); xlabel('time (ms)'),ylabel('m');hold on; subplot(222);plot(t,x(:,3)) xlabel('time (ms)'),ylabel('h');hold on; subplot(223);plot(t,x(:,4)); xlabel('time (ms)'),ylabel('n');hold on; clear VRay taum minf tauh hinf taun ninf; VRay=[-75:.50001:75]; for k = 1:length(VRay); V=VRay(k); taum(k)=1/(0.1*(V+40)/(1-exp(-(V+40)/10))+4*exp(-(V+65)/18)); minf(k)=(0.1*(V+40)/(1-exp(-(V+40)/10)))*taum(k); tauh(k)=1/(0.07*exp(-(V+65)/20)+(1/(1+exp(-(V+35)/10)))); hinf(k)=0.07*exp(-(V+65)/20)*tauh(k); taun(k)=1/(0.01*(V+55)/(1-exp(-(V+55)/10))+0.125*exp(-(V+65)/80)); ninf(k)=(0.01*(V+55)/(1-exp(-(V+55)/10)))*taun(k); end figure(3);subplot(211);plot(VRay,taum,VRay,tauh,VRay,taun); title('TAUS FOR m, h and n'),xlabel('voltage (mv)');hold on; subplot(212);plot(VRay,minf,VRay,hinf,VRay,ninf); title('INFS FOR m, h and n'),xlabel('voltage (mv)');hold on; figure(1);