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]=Isin(t)
function [Amplitude]=Isin(t)
%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    =   5000;   %Hz
%Amp         =   -0.1;   %uA  %for Iinstim
Amp         = 1000;    %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