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]=SquarePulse(t)
function [Amplitude]=SquarePulse(t)
%Input
%   t          (us)
%Output
%   Amplitude  (uA)
%   setting the Amplitude to empty indicates the end of the stimulus
%   pulse. This help speed up the calculation
%----------------------------------------
Pulsewidth  =   100;    %us
Delay       =   0;      %us
Amp         =   0.01;   %uA
%----------------------------------------

if t<=Delay
    Amplitude=0;
elseif t <= (Delay+Pulsewidth)
    Amplitude=Amp;
else
    Amplitude=[];
end

Contact us at files@mathworks.com