Location: Hodgkin & Huxley (1952) model @ 4014d7d93ea1 / sed-ml / scripts_BG / Na_gating_m.m

Author:
WeiweiAi <wai484@aucklanduni.ac.nz>
Date:
2021-11-15 14:52:41+13:00
Desc:
Move figure creation outside of the function
Permanent Source URI:
https://staging.physiomeproject.org/workspace/64f/rawfile/4014d7d93ea1ef758966dbcfd1859e3950465a46/sed-ml/scripts_BG/Na_gating_m.m

clear;
clc;
close all;
addpath(genpath('../../cellLib/BG_fit/'))
T = 279.45;
phi = 3^((T - 6.3-273.15) / 10);

%% Steady-state gating parameters and time constants
V = transpose(-120:1:60); % unit mV
[alpha,beta]=HH_gate_m(-(V+75),phi);
TF = isnan(alpha);
alpha(TF)=1;
tau = calc_tau(alpha,beta);
g_ss = calc_gss(alpha,beta);
%% Optimization to fit
[params_vec,fval,exitflag,output] = gate_fit(alpha,beta,g_ss,tau,V,T);
save(['Na_m_parameters.mat'],'params_vec');
%% Plot
h = figure;
x0=100;
y0=50;
height=350*2;
width=400*2;
set(gcf,'position',[x0,y0,width,height])
gate_plot(alpha,beta,g_ss,tau,params_vec,V,T);
filename='m_gate.fig';
savefig(h,filename)

function [alpha_m,beta_m]=HH_gate_m(V,phi)

alpha_m = 0.1 .* (V + 25) .* phi ./ (exp( (V + 25) ./ 10) -1 );
beta_m = 4 .* exp( V ./ 18 ) .* phi;
end