

N1=8;
N2=4;
N3=3;
N4=2;
N5=1;
p=0:0.01:1;
Throughput1 =N1p.(1-p).^(N1-1);
Throughput2 =N2p.(1-p).^(N2-1);
Throughput3 =N3p.(1-p).^(N3-1);
Throughput4 =N4p.(1-p).^(N4-1);
Throughput5 =N5p.(1-p).^(N5-1);
figure
plot(p,Throughput1,p,Throughput2,p,Throughput3,p,Throughput4,p,Throughput5);
xlabel('发送数据的时间')
ylabel('信道空闲的时间')
title('基于帧的时隙ALOHA(FSA)算法')
legend('N=8','N=4','N=3','N=2','N=1')