⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 theorys.m

📁 数字通信调制解调
💻 M
字号:
% Program 6-4
% theorys.m
%
% The calculation of the theory value of the throughput
%
% Input arguments
%   no	: protocol number   1 : Pure ALOHA
%                           2 : Slotted ALOHA
%                           3 : np-CSMA
%                           4 : Slotted np-ISMA
%   g   : offered traffic (scalar or vector)
%   a   : normalized propagation delay
%
% Output argument
%   ts  : the theory value of the throughput (scalar or vector)
%
% Programmed by M.Okita
% Checked by H.Harada
%

function [ts] = theorys(no,g,a)

switch no
case 1                                              % Pure ALOHA
    ts = g .* exp(-2*g);
case 2                                              % Slotted ALOHA
    ts = g .* exp(-g);
case 3                                              % Non-Persistent Carrier Sense Multiple Access
    ts = g .* exp(-a*g) ./ (g*(1+2*a)+exp(-a*g));
case 4                                              % Slotted Non-Persistent ISMA
    ts = a * g .* exp(-a*g) ./ (1+a-exp(-a*g));
end

%%%%%%%%%%%%%%%%%%%%%% end of file %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -