?? reliability3.asv
字號:
o=zeros(9,7);p=0.2628;
for l=1:9
x=0;
for k=1:7
x=x+1;
s=0;
suc=0;
for i=1:1000
count=0;
count1=0;
for j=1:8
v=1;
for h=1:5
if v==1
s=s+1;
a=rand();
if a<p^k
v=0;
else
for m=1:k
if a<p^m
s=s+1;
end
end
end
end
end
if v==1
count=count+1;
end
end
for j=8:8+l-1
v=1;
for h=1:5
if v==1
s=s+1;
a=rand();
if a<p^k
v=0;
else
for m=1:k
if a<p^m
s=s+1;
end
end
end
end
end
if v==1
count1=count1+1;
end
end
if count1+count>=8
suc=suc+8;
else
suc=suc+count;
end
end
o(l,x)=s/5/suc;
end
end
i=[0:1:6];
plot(i,o(1,:),'-o',i,o(2,:),'-+',i,o(3,:),'-*',i,o(4,:),'-d',i,o(5,:),'-p',i,o(6,:),'-x',i,o(7,:),'.',i,o(8,:),'-o',i,o(9,:),'-+')
% axis([0,6,0,4]);
legend 0 1 2 3 4 5 6 7 8
grid;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -