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

[xyz] =setxyz(xyzi,xyzc,L,nseg);
function [xyz] =setxyz(xyzi,xyzc,L,nseg);
%xyzi=vector
%xyzc=the coordinate of the center node

if nseg<1 | ceil(nseg)~=fix(nseg)
    zexst('err','Error in SetXYZ: Nseg needs to be an integer.');
	return   
elseif nseg==1
    xyz=xyzc;
else
    unitvector=xyzi/sqrt(xyzi(1)^2+xyzi(2)^2+xyzi(3)^2);
    temp= L/nseg*[(1-nseg)/2:1:(nseg-1)/2;]';
    xyz=zeros(nseg,3);
    for i=1:3
        xyz(:,i)=temp*unitvector(i)+xyzc(i);
    end
end

Contact us at files@mathworks.com