-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetControlMatrix.m
More file actions
25 lines (22 loc) · 1.47 KB
/
getControlMatrix.m
File metadata and controls
25 lines (22 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function controlMatrix=getControlMatrix(vref,connectivity,state,deltaT,excitable_threshold,exciting_threshold)
width = sqrt(size(connectivity,1));
excitedV=128.2198;
controlMatrix = zeros(size(connectivity,1),size(connectivity,1));
for i =1:size(controlMatrix,1)
if state(i)< excitable_threshold
if connectivity(i,1)~=0&&state(i+1)<exciting_threshold(1)&&state(i+1)>exciting_threshold(2)%&&state(i+1)>exciting_threshold
%controlMatrix(i,i+1)=1+offset(state(i+1),deltaT,vref);
controlMatrix(i,i+1) = (excitedV-state(i))/state(i+1);
elseif connectivity(i,2)~=0&&state(i+width)<exciting_threshold(1)&&state(i+width)>exciting_threshold(2)%%&&state(i+width)>exciting_threshold
%controlMatrix(i,i+width)=1+offset(state(i+width),deltaT,vref);
controlMatrix(i,i+width) = (excitedV-state(i))/state(i+width);
elseif connectivity(i,3)~=0&&state(i-1)<exciting_threshold(1)&&state(i-1)>exciting_threshold(2)%&&state(i-1)>exciting_threshold
%controlMatrix(i,i-1)=1+offset(state(i-1),deltaT,vref);
controlMatrix(i,i-1) = (excitedV-state(i))/state(i-1);
elseif connectivity(i,4)~=0&&state(i-width)<exciting_threshold(1)&&state(i-width)>exciting_threshold(2)%&&state(i-width)>exciting_threshold
%controlMatrix(i,i-width)=1+offset(state(i-width),deltaT,vref);
controlMatrix(i,i-width) = (excitedV-state(i))/state(i-width);
end
end
end
end