No BSD License  

Highlights from
Neurocal

image thumbnail
from Neurocal by Zeng Lertmanorat
Simulation describing the electrical activity of nerve cell (neuron) by solving cable equation

[Amplitude]=Isinthc(t)
function [Amplitude]=Isinthc(t)
global blockth

%Input
%   t          (us)
%Output
%   Amplitude  (uA)
%   setting the Amplitude to empty indicates the end of the stimulus
%   pulse. This helps speed up the calculation
%--------------------------------------------------------------------------
Delay   =   0;
Dur     =   40000;          %us
freq    =   blockth.freq;   %Hz
Amp     =   -1;           %uA  %for Iexstim
%--------------------------------------------------------------------------
if t<Delay
    Amplitude=0;
elseif t < (Delay+Dur)
    Amplitude=Amp*sin(2*pi*freq*t/1000000);
else
    Amplitude=[];
end

Contact us at files@mathworks.com