get_beacons.m

来自「Introduction to Estimation and the Kalma」· M 代码 · 共 34 行

M
34
字号
function beacons=get_beacons
%
%  beacons=get_beacons
%
% HDW 28/04/00
% function to graphically input beacon locations
% beacons is 2*N matrix containing x,y locations of beacons


% set up the figure

globals;
figure(PLAN_FIG)
clf
v=[0 WORLD_SIZE 0 WORLD_SIZE];
axis(v);
hold on;
bin=1;
nbeacons=0;
beacons=zeros(1,2);

% now get beacons graphically until return 
while bin
   [x,y]=ginput(1);
   bin= ~isempty(x);
   if bin
      nbeacons=nbeacons+1;
      plot(x,y,'go')
      beacons(nbeacons,1)=x;
      beacons(nbeacons,2)=y;
   end
end
hold off

⌨️ 快捷键说明

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