无线传感器网络中的移动性

问题描述 投票:0回答:1
points = [200, 200;
          200, 180;
          180, 180;
          180, 200;
          40, 40;
          40, 160;
          160, 160;
          160, 40]
for s = 1 : size(points, 1)
  fprintf('Plotting (%d, %d)\n', points(s,1), points(s, 2));
  pause(5);

我已经以这种方式完成了代码...我想使接收器/基站的位置移动,使其以一定的速度移动...我做对了吗?因为我认为它只会考虑最后一个值,并且不会更新实时值?有什么建议么???结束

matlab performance networking communication wireless
1个回答
0
投票

您可以确定x和y轴上的速度(vxvy),然后通过xy方程生成移动体的位置(x = v*t + x0y = v*t + y0),其中t为时间,x0y0是初始位置。

x0 = 0; % Start Point
y0 = 0; % Start Point
t=1:0.1:100
vx = 1; % initial velocity 
vy = 1; % initial velocity 
x = vx.*t + x0;
y = vy.*t + y0;
© www.soinside.com 2019 - 2024. All rights reserved.