资源简介
文件内包含有多个定位算法的matlab代码:DTOA,chan算法,克拉美罗界,泰勒算法等等
代码片段和文件信息
r=[500 1000 1500 2000 3000 4000]; %r为半径
total = [0 0 0 0 0 0];
Noise = 50;
for i = 1: 6
for m = 1: 10000
ms=[100;300];
bs1=[000]; %服务基站BS0的坐标
bs2=[0sqrt(3)*r(i)0];
bs3=[3*r(i)/2sqrt(3)*r(i)/20];
bs4=[-3*r(i)/2-sqrt(3)*r(i)/20];
bs5=[-3*r(i)/2sqrt(3)*r(i)/20];
bs6=[3*r(i)/2-sqrt(3)*r(i)/20];
bs7=[0-sqrt(3)*r(i)0];
r1=sqrt((bs1(1)-ms(1))^2+(bs1(2)-ms(2))^2);
bs2(3)=sqrt((bs2(1)-ms(1))^2+(bs2(2)-ms(2))^2)-r1;
bs2(3)=bs2(3)+ Noise*randn(1);
bs3(3)=sqrt((bs3(1)-ms(1))^2+(bs3(2)-ms(2))^2)-r1;
bs3(3)=bs3(3)+ Noise*randn(1);
bs4(3)=sqrt((bs4(1)-ms(1))^2+(bs4(2)-ms(2))^2)-r1;
bs4(3)=bs4(3)+ Noise*randn(1);
bs5(3)=sqrt((bs5(1)-ms(1))^2+(bs5(2)-ms(2))^2)-r1;
bs5(3)=bs5(3)+ Noise*randn(1);
bs6(3)=sqrt((bs6(1)-ms(1))^2+(bs6(2)-ms(2))^2)-r1;
bs6(3)=bs6(3)+ Noise*randn(1);
bs7(3)=sqrt((bs7(1)-ms(1))^2+(bs7(2)-ms(2))^2)-r1;
bs7(3)=bs7(3)+ Noise*randn(1);
bs=[bs1;bs2;bs3;bs4;bs5;bs6;bs7];
n=7;
ms1 = CHANFUC(nbs);
total(i) = (ms1(1) - ms(1))^2 + (ms1(1) - ms(1))^2 + total(i);
end
rmse(i) = sqrt(total(i)/10000);
end
- 上一篇:基于4个特征的阴影检测算法
- 下一篇:FCM模糊聚类matlab代码
评论
共有 条评论