forked from ssumithra/PowerLawCriticalityPaper
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcheck.m
executable file
·48 lines (45 loc) · 1.03 KB
/
check.m
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
41
42
43
44
45
46
47
48
function[A]=check(N)
A=bwlabel(N,4);
n = size(N,1);
for j=1:n
if(A(n,j)>0 && A(1,j)>0 && A(n,j)< A(1,j))
x=A(1,j);y=A(n,j);
for k=1:n
for l=1:n
if(A(k,l)==x)
A(k,l)=y;
end
end
end
elseif(A(n,j)>0 && A(1,j)>0 && A(n,j)> A(1,j))
x=A(n,j);y=A(1,j);
for k=1:n
for l=1:n
if(A(k,l)==x)
A(k,l)=y;
end
end
end
end
end
for i=1:n
if(A(i,n)>0 && A(i,1)>0 && A(i,n)<A(i,1))
x=A(i,1);y=A(i,n);
for k=1:n
for l=1:n
if(A(k,l)==x)
A(k,l)=y;
end
end
end
elseif(A(i,n)>0 && A(i,1)>0 && A(i,n)>A(i,1))
y=A(i,1); x=A(i,n);
for k=1:n
for l=1:n
if(A(k,l)==x)
A(k,l)=y;
end
end
end
end
end