1 Star 1 Fork 0

王成呈/WhereAmI

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
predict_location.m 605 Bytes
一键复制 编辑 原始数据 按行查看 历史
function [closest_position] = predict_location(offline_fingerprints,newpoint_fingerprint)
%PREDICT_LOCATION Calculate the distance vector between newpoint and all
%points in the offline database then return the position with least
%distance
N = size(offline_fingerprints,1);
distances = zeros(N,1);
for idx = 1 : N
distances(idx) = sqrt(sum((offline_fingerprints(idx,3:end) - newpoint_fingerprint).^2));
end
[sorted_distances,row_indices] = sort(distances);
closest_row_index = row_indices(1:1);
closest_position = offline_fingerprints(closest_row_index,1:2);
end
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cheng-cheng-wang/WhereAmI.git
git@gitee.com:cheng-cheng-wang/WhereAmI.git
cheng-cheng-wang
WhereAmI
WhereAmI
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385