📄 hh_threshold_fun.m
字号:
function [value , isterminal , direction] = hh_threshold_fun(t , y)
% HH_THRESHOLD_FUN Threshold function for Hodgkin-Huxley model
%
% Version: 1.0
% ----------------------------------
% Amir Reza Saffari Azar, August 2004
% amir@ymer.org
% http://www.ymer.org
% http://ee.sut.ac.ir/faculty/saffari/main.index
global net
state_num = net.Neurons.Model.StateNum;
%---setting parameters
if ischar(net.Neurons.SpikeDet.SpikeDetFunParam)
switch lower(net.Neurons.SpikeDet.SpikeDetFunParam)
case 'def'
threshold = 0*ones(net.Architecture.NeuronNum , 1);
otherwise
error('Unknown threshold parameters')
end
else
if length(net.Neurons.SpikeDet.SpikeDetFunParam) == 1
threshold = net.Neurons.SpikeDet.SpikeDetFunParam*ones(net.Architecture.NeuronNum , 1);
elseif length(y) ~= state_num*length(net.Neurons.SpikeDet.SpikeDetFunParam)
error('Threshold vector size does not match with the number of neurons')
else
threshold = net.Neurons.SpikeDet.SpikeDetFunParam;
end
end
%---checking for threshold crossing
y2check = y(1:state_num:end);
value2check = y2check - threshold;
value = ones(size(y));
value(1:state_num:end) = value2check;
isterminal = ones(size(y));
direction = ones(size(y));
return
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -