bspos.m
来自「It s a simulation for WCDMA Radio Networ」· M 代码 · 共 83 行
M
83 行
%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 + =
减小字号Ctrl + -
显示快捷键?