% F2_6.m % Carol Lucas % To make life easy for entering changes, suggest that you set up a % matrix in the command window, e.g., set parameters at starting values % then move them to a matrix, e.g. to start with text example. % Voa=-25;Soa=5;Voi=-50;Soi=-2;phi=1/.2; % B=[Voa Soa Voi Soi phi]; % then just enter B at the prompt signal. Anytime you change a parameter, % just be sure to reactivate the 'B=[...' line. % Hitting return without 5 entries leads to default values. P=input('Please enter[Voa Soa Voi Soi phi] as row matrix: '); if length(P)~=5; Voa=-25;Soa=5;Voi=-50;Soi=-2;phi=1/.2; else Voa=P(1);Soa=P(2);Voi=P(3);Soi=P(4);phi=(5);; end; V=[-75:25]; noa=.5*(1+tanh((V-Voa)/(2*Soa))); noi=.5*(1+tanh((V-Voi)/(2*Soi))); figure(1);clf;plot(V,noa,'b',V,noi,'g'); xlabel('voltage (mV)'),ylabel('no');axis([-75 25 0 1]); title('no vs V, active channel=blue, inactive channel=green');pause; ta=phi./cosh((V-Voa)/(2*Soa)); ti=phi./cosh((V-Voi)/(2*Soi)); figure(2);clf;plot(V,ta,'b',V,ti,'g'); xlabel('voltage (mV)'),ylabel('tau (ms)');axis([-75 25 0 5]); title('tau vs V, active channel=blue, inactive channel=green');pause;