RSSI定位算法matlab
%%%RSSI 室内定位算法
clear all;
clc;
% 热点数目为3个
n = 3;
%热点坐标为(0,0)、(70,20)、(10,70)
BS = [0 0; 70 20; 10 70];
% 待定位点的实际坐标
MS_ini = [30 30];
%从待定位点到每个热点的实际距离
picture_RSSI = 1;
for i = 1:n
actual_distance_MS_BS(i) = sqrt((MS_ini(1)-BS(i,1))^2 + (MS_ini(2)-BS(i,2))^2);
end
if picture_RSSI == 1
figure (1)
title('RSSI----待定位点的实际坐标');
for i =1:n
c = BS(i,:);
r = actual_distance_MS_BS(i);
2021-12-13 11:54:31
3KB
matlab
1