-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreatecirculardomain.m
More file actions
40 lines (33 loc) · 1016 Bytes
/
Copy pathcreatecirculardomain.m
File metadata and controls
40 lines (33 loc) · 1016 Bytes
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
function [newdomain]=createcirculardomain(diam,sizesimspace)
% function [newdomain]=createcirculardomain(diam,sizesimspace)
% simulation space: sizesimspace x sizesimspace pixels de 1 nm
% 1 cercle with diameter diam
%
% Marianne Renner 04/22
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
newdomain=zeros(sizesimspace,sizesimspace);
poscentro=round(sizesimspace/2);
centro=round(diam/2);
radio=diam/2;
synapse=zeros(diam+1,diam+1); %total image
for i=1:diam+1
for j=1:diam+1
distcentro=sqrt((centro-i)^2+(centro-j)^2);
if distcentro<diam/2
synapse(i,j)=1;
end
end
end
t=1;
for i=poscentro-radio : poscentro+radio
k=1;
for j=poscentro-radio:poscentro+radio
newdomain(i,j)=synapse(t,k);
k=k+1;
end
t=t+1;
end
%figure
%imshow(newdomain,'InitialMagnification','fit')
clear synapse synapse2 numberpergroup
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%