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

📄 distance.m

📁 数字通信调制解调
💻 M
字号:
% 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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

⌨️ 快捷键说明

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