资源简介
在matlab中对使用了ALOHA协议的系统进行用户数量和碰撞率关系的仿真
代码片段和文件信息
Vel=10;
% the velocity of the data flow (信息传输速率λ )
Tplen=0.03125;
% the length of the frame in second (Pflens)
ta=1;
% the reading time
x1=0;
y1=0;
k=1:7;
for NUM=1:1:7;
for i=1:100
for j=0:1:(i-1)
x=exp(-1*Vel*(ta-j*Tplen))*((Vel*(ta-j*Tplen)).^j)/factorial(j);
x1=x1+x;
end
y=(1-exp(-2*Vel*Tplen*(NUM-1))).^(i-1)*x1;
y1=y1+y;
x1=0;
end
Pfr0(NUM)=exp(-2*Vel*Tplen*(NUM-1))*y1
y1=0;
end
ta=2;
% the reading time
x1=0;
y1=0;
k=1:7;
for NUM=1:1:7;
for i=1:100
for j=0:1:(i-1)
x=exp(-1*Vel*(ta-j*Tplen))*((Vel*(ta-j*Tplen)).^j)/factorial(j);
x1=x1+x;
end
y=(1-exp(-2*Vel*Tplen*(NUM-1))).^(i-1)*x1;
y1=y1+y;
x1=0;
end
Pfr1(NUM)=exp
评论
共有 条评论