No BSD License  

Highlights from
CoCoMac

image thumbnail
from CoCoMac by James Allen
Download CoCoMac.org cortical connectivity data, model it as a network, and simulate epileptic sprea

testThresh(thresh, noOfNodes, activ, timeStepCnt, alpha, net)
function [result] = testThresh(thresh, noOfNodes, activ, timeStepCnt, alpha, net)

% calculate node activities at given time step using given threshold value to see if it satifies
% (sum(activ(timeStepCnt - 1, :)) < sumOfActivThisTimestep <= alpha)
% If it does, return 1 - else return 0.

for nodeCnt = 1:noOfNodes

    %calculate sum of inputs ("other nodes")
    sumOfInputs = 0;
    for otherNodeCnt = 1:noOfNodes
        if (otherNodeCnt ~= nodeCnt)
            couplStr = net(nodeCnt, otherNodeCnt) ^ 2; % Coupling strength = fibre density squared between startnode nodeCnt and endNode otherNodeCnt
            sumOfInputs = sumOfInputs + couplStr * activ(timeStepCnt-1, otherNodeCnt);
        end
    end
    
    sumInputsMinusThresh = sumOfInputs - thresh;

    if sumInputsMinusThresh > 0
        activ(timeStepCnt, nodeCnt) = 1;
    else
        activ(timeStepCnt, nodeCnt) = 0;
    end

end

sumOfActivThisTimestep = sum(activ(timeStepCnt, :));
result = (sum(activ(timeStepCnt - 1, :)) < sumOfActivThisTimestep) & (sumOfActivThisTimestep <= alpha);

return;

Contact us at files@mathworks.com