r1=zeros(10000,1); %可行性列向量
i=1;
t=0;
while (i<=100000)
m1=[0 1 1 0 0 0 0 0 0;0 0 1 1 1 0 0 0 0; 0 1 0 0 1 1 0 0 0; 0 0 0 0 1 0 1 0 0;
0 1 1 1 0 1 1 1 0 ; 0 0 0 0 1 0 0 1 0 ; 0 0 0 0 1 0 0 1 1 ; 0 0 0 0 1 0 1 0 1 ; 0 0 0 0 0 0 0 0 0 ; ];%初始矩阵
s2 = randi(10,9,9);%随机数矩阵
for t=2:8
if s2(t)>=10
m1(4,t)=0;
m1(t,4)=0;
end
end
for t=79:80
if s2(t)>=10
m1(t)=0;
end
end
for t=12:13
if s2(t)>=10
m1(1,t-10)=0;
end
end
if s2(30)>=10
m1(2,3)=0;
m1(3,2)=0;
end
if s2(40)>=10
m1(6,7)=0;
m1(7,6)=0;
end
b=m1+m1^2+m1^3+m1^4;
b=b*(m1^4+1);
if b(1,9)>0
r1(i)=1;
else r1(i)=0;
end
i=i+1;
end
c=norm(r1, 1)/100000;
06-22