• 大小: 72KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-06
  • 语言: Matlab
  • 标签: UWB,matlab  

资源简介

超宽带四个基站,设置25个测试点,画出测距误差分布热图(含数据),matlab

资源截图

代码片段和文件信息

%% 测距误差热度图-针对1个测试点对其中一个基站的测距误差
% 首次按每个测试点对应A1,再A2,A3,A4,
clcclear
TagPoints = load(‘TagPoints.txt‘);%25组坐标
AnchorPoints = load(‘AnchorPoints.txt‘);%基站位置1001151F15221521
TrueDis=f_TureDistance(TagPointsAnchorPoints);%真实距离

%% -制作测距误差热图
% 测距顺序,每个数据循环的第一组不一定相同,利用改成相同的此顺序1001151F15221521
x = [];
y = [];
for k=1:25  %//共25组文件    
    for i = 1:4
        filename = [‘T‘int2str(k)‘SolvedDistance‘int2str(i)‘.txt‘];   
        Matrix = importdata(filename);
        Matrix = Matrix(1:500:);
        meanDis(i) = mean(Matrix(:1));
        error(ki) = sqrt((meanDis(i)-TrueDis(k1))^2);%error25行4列
    end  
end
MatrixMain = [TagPoints(:1)TagPoints(:2)error];%6列
x = MatrixMain(:1);
y = MatrixMain(:2);
%分别为3\4\5\6列,每次运行注释其中三个
% z = MatrixMain(:3);%画所有点的均值误差对A1
% z = MatrixMain(:4);%画所有点的均值误差对A2
% z = MatrixMain(:5);%画所有点的均值误差对A3
z = MatrixMain(:6);%画所有点的均值误差对A4ss
% scatter(xy5z)%散点图
% figure
[XYZ]=griddata(xyzlinspace(min(x)max(x))‘linspace(min(y)max(y))‘v4‘);%插值
%%  先画出测试点的坐标示意图,不然标注会有错误
plot(AnchorPoints(:1)AnchorPoints(:2)‘ok‘);

for i=1:length(AnchorPoints)
    text(AnchorPoints(i1)+5AnchorPoints(i2)[‘A‘int2str(i)]);
end
hold on
plot(TagPoints(:1)TagPoints(:2)‘*k‘);%画出测试点的图
for i=1:length(TagPoints)
    text(TagPoints(i1)+5TagPoints(i2)[‘T‘int2str(i)])
end
hleg1=legend(‘基站‘‘测试点‘‘Location‘‘Northeast‘);
legend(‘boxoff‘)
%%
figure(1)
% subplot(221)%做出的图不好看
pcolor(XYZ);shading interp%伪彩色图
colorbar 
%%
figure(2)
% subplot(222)
v = 0:10:max(z);
[Ch]=contour(XYZv‘LineWidth‘1.2‘ShowText‘‘on‘);%等值线图
clabel(Ch‘color‘‘g‘)

ylabel(‘y / cm‘)
xlabel(‘x / cm‘)
axis([0 250 0 250]) 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件         28  2017-11-09 23:37  wucharetu\AnchorPoints.txt

     文件       1921  2018-03-30 14:03  wucharetu\errorDis.m

     文件        337  2017-11-10 14:12  wucharetu\f_TureDistance.m

     文件       4982  2017-11-26 14:05  wucharetu\T10SolvedDistance1.txt

     文件       4982  2017-11-26 14:05  wucharetu\T10SolvedDistance2.txt

     文件       4987  2017-11-26 14:05  wucharetu\T10SolvedDistance3.txt

     文件       4982  2017-11-26 14:05  wucharetu\T10SolvedDistance4.txt

     文件       3090  2017-11-26 14:05  wucharetu\T11SolvedDistance1.txt

     文件       3090  2017-11-26 14:05  wucharetu\T11SolvedDistance2.txt

     文件       3090  2017-11-26 14:05  wucharetu\T11SolvedDistance3.txt

     文件       3090  2017-11-26 14:05  wucharetu\T11SolvedDistance4.txt

     文件       3380  2017-11-26 14:05  wucharetu\T12SolvedDistance1.txt

     文件       3380  2017-11-26 14:05  wucharetu\T12SolvedDistance2.txt

     文件       3380  2017-11-26 14:05  wucharetu\T12SolvedDistance3.txt

     文件       3380  2017-11-26 14:05  wucharetu\T12SolvedDistance4.txt

     文件       4225  2017-11-26 14:05  wucharetu\T13SolvedDistance1.txt

     文件       4230  2017-11-26 14:05  wucharetu\T13SolvedDistance2.txt

     文件       4230  2017-11-26 14:05  wucharetu\T13SolvedDistance3.txt

     文件       4230  2017-11-26 14:05  wucharetu\T13SolvedDistance4.txt

     文件       3230  2017-11-26 14:05  wucharetu\T14SolvedDistance1.txt

     文件       3230  2017-11-26 14:05  wucharetu\T14SolvedDistance2.txt

     文件       3230  2017-11-26 14:05  wucharetu\T14SolvedDistance3.txt

     文件       3230  2017-11-26 14:05  wucharetu\T14SolvedDistance4.txt

     文件       3835  2017-11-26 14:05  wucharetu\T15SolvedDistance1.txt

     文件       3835  2017-11-26 14:05  wucharetu\T15SolvedDistance2.txt

     文件       3835  2017-11-26 14:05  wucharetu\T15SolvedDistance3.txt

     文件       3830  2017-11-26 14:05  wucharetu\T15SolvedDistance4.txt

     文件       3430  2017-11-26 14:05  wucharetu\T16SolvedDistance1.txt

     文件       3425  2017-11-26 14:05  wucharetu\T16SolvedDistance2.txt

     文件       3430  2017-11-26 14:05  wucharetu\T16SolvedDistance3.txt

............此处省略78个文件信息

评论

共有 条评论

相关资源