保证正确无误的Multiple access protocls源代码。包括ALOHA, CSMA, ISMA等等。写论文

源代码在线查看: distance.m

软件大小: 12 K
上传用户: wuqiweipp
关键词: Multiple protocls access ALOHA
下载地址: 免注册下载 普通下载 VIP

相关代码

				% Program 6-3
				% distance.m
				%
				% The calculation of distance between access point and access terminal.
				%
				% Input arguments
				%   bstn : coordinate of access point(x,y,z)
				%   mstn : coordinate of access terminals(x,y,z) (mstn is vector or matrix)
				%   stp  : scale (if stp is omitted, scl=1.)
				%
				% Output argument
				%   d    : distance
				%
				% Programmed by M.Okita
				% Checked by H.Harada
				%
				
				function [d] = distance(bstn, mstn, scl)
				
				if nargin < 3                                                       % stp is omitted
				    scl = 1;
				end
				
				[v,h] = size(mstn);
				d     = sqrt(sum(rot90(((repmat(bstn,v,1)-mstn)*scl).^2)));
				
				%%%%%%%%%%%%%%%%%%%%%% end of file %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
							

相关资源