1 Star 0 Fork 0

gzl2012/lmx_ems_sim

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
mydistance.m 528 Bytes
一键复制 编辑 原始数据 按行查看 历史
LiAnn 提交于 2018-05-10 13:47 . test OK.
function d = mydistance(x,S)
% x Compared position
% S Defined to save current waypoints and obstacles for distance check, in form of [x1 x2 x3 ...xn]
% d Minimum distance between x and (x1 x2 x3 ...xn)
sz = size(S);
if isempty(S)==1 % If S is empty, we set a distance larger than r
d = 1000000000000000000;
else % If S is not empty
A = repmat(x,1,sz(2)) - S;
for k=1:sz(2) % Distance in horizontal direction
Norm_Store(k)=norm(A(1:2,k));
end
d = min(Norm_Store);
end
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gzl2012/lmx_ems_sim.git
git@gitee.com:gzl2012/lmx_ems_sim.git
gzl2012
lmx_ems_sim
lmx_ems_sim
master

搜索帮助