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

📄 bspos.m

📁 这个是芬兰人写的《WCDMA无线网络规划与优化》书上对应的Matlab源代码。这本书很经典。
💻 M
字号:
%BSPOS   [BASESTATION NUMBSS] = BSPOS(N, BASESTATION, NUMFIG) manual positioning of the BSs
%        on the map
%
%        [BASESTATION NUMBSS] = BSPOS(N)
%                                  create N new BSs in new figure
%        [BASESTATION NUMBSS] = BSPOS(N, BASESTATION)
%                                  add N new BSs to BASESTATION in new figure
%        [BASESTATION NUMBSS] = BSPOS(N, BASESTATION, NUMFIG)
%                                  create/add N new BSs in figure NUMFIG
%
%Inputs:
%   BASESTATION: Structure holding BS parameters (optional)
%   N          : Number of BSs to add
%                if N = -1: add until right mouse click (mandatory)
%   FIGNUM     : figure number of current figure (optional)
%Outputs:
%   BASESTATION: Structure holding BS parameters after adding BSs
%   NUMBSS     : New number of base stations
%
%Authors : Achim Wacker (AWa), Jaana Laiho-Steffens (jls)
%
%Revision: 5.0.0cd   Date: 17-Jul-2001
%
%needed m-files: BSplot

function [basestation, numBSs] = BSpos(N, basestation, numFig)

vectMap  = evalin('base', 'vectMap');
lossData = evalin('base', 'lossData');

if (nargin == 1)
   activeBS = 0;
   fignum = figure;
   curaxis = [1 10 1 10];
elseif (nargin == 2)
   activeBS = length(basestation);
   fignum == figure;
   curaxis = [1 10 1 10];
elseif (nargin == 3)
   activeBS = length(basestation);
   curaxis = axis;
   fignum = numFig;
else
   error(' wrong number of input arguments');
end

disp(' click with the mouse the positions of the base station(s) ')
figure(fignum);
axis(curaxis);

%disp any old BSs
if (activeBS ~= 0)
   BSplot(basestation, fignum, vectMap, lossData);
end   

if (N == -1)
   while (1)
      activeBS = activeBS+1;
      [x, y, button] = ginput(1);
      basestation(activeBS) = BSdefault;
      basestation(activeBS).x = x;
      basestation(activeBS).y = y;
      BSplot(basestation, fignum, vectMap, lossData);
      axis(curaxis);
      if (button == 3)
         break;
      end
   end
else
   while (N > 0)
      activeBS = activeBS+1;
      [x, y, button] = ginput(1);
      basestation(activeBS) = BSdefault;
      basestation(activeBS).x = x;
      basestation(activeBS).y = y;
      BSplot(basestation, fignum, vectMap, lossData);
      axis(curaxis);
      N = N-1;
   end
end

numBSs = length(basestation);

⌨️ 快捷键说明

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