⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 measurement.asv

📁 目标跟踪的扩展卡尔曼滤波算法主函数的文件是:kal_demo.m 近似网格滤波的主函数文件是:bayes_demo.m 近似网格滤波划分网格的方法是:以目标上一个时刻的位置作为中心进行网格
💻 ASV
字号:
function [ distances count list] = measurement(sensors, leader, slot, detect_max, com_radius)
% Measure the distances
%
% INPUT
%       sensors(:) : the location of the sensors
%       leader : the leader at time t
%       slot(:) : the loaction of an object at time t
% OUPUT
%       distances() : an array of distance from an object to a sensor
%       count : the count of sensors that can detect
%       list() : the list of sensors
%       
% Measure the distances from the neighbors of the leader 
% that can detect to an object

distances = 0;
count = 0;
list = 0;

for num = 1:400
    
    leader_sensor = (sensors(1,num)-sensors(1,leader))^2+(sensors(2,num)-sensors(2,leader))^2;
    sensor_object = (sensors(1,num)-slot(1,1))^2 + (sensors(2,num)-slot(2,1))^2;
    
    if leader_sensor <= com_radius^2 && sensor_object <=detect_max^2
        if list == 0;
            list = num;
            distances  = sqrt(sensor_object);
        else
            list = [list,num];
            distances  = [distances,sqrt(sensor_object)];
        end
        count = count + 1;
    end
end
    
distances = distances*randint(1,10,[8000,12000])*0.0001

⌨️ 快捷键说明

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