-
Notifications
You must be signed in to change notification settings - Fork 0
/
dealRadioCORS.m
87 lines (86 loc) · 1.93 KB
/
dealRadioCORS.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
%%
%matlab
%比较HLJCORS和广播CORS的定位精度
%采用功分器,1个天线,2个流动站,分别接入2个CORS系统。
%读取HLJCOR定位结果文件,格式:x y H
%读取radio定位结果文件,格式:x y H
%by zzh_my@163.com。
%create at 2017-2-28
clear all
disp('this is local ');
%%
%打开文件,读取HLJCORS定位结果
[openFileName,openPathName]=uigetfile('HLJCORS.xyH','打开HLJCORS文件');
if(openFileName==0)
error('open file failed!')
end
openFnamePname=strcat(openPathName,openFileName);
hljcorsAll=load(openFnamePname);
hljcorsX=hljcorsAll(:,1);
hljcorsY=hljcorsAll(:,2);
hljcorsH=hljcorsAll(:,3);
%打开文件,读取radio定位结果
[openFileName,openPathName]=uigetfile('radio.xyH','打开radio文件');
if(openFileName==0)
error('open file failed!')
end
openFnamePname=strcat(openPathName,openFileName);
radioAll=load(openFnamePname);
radioX=radioAll(:,1);
radioY=radioAll(:,2);
radioH=radioAll(:,3);
%%
%X方向
for i=1:length(radioX)
chazhiX(i)=radioX(i)-hljcorsX(1);
for j=1:length(hljcorsX)
tempX=radioX(i)-hljcorsX(j);
if(abs(tempX)<abs(chazhiX(i)))
chazhiX(i)=tempX;
end
end
end
%%
%Y方向
for i=1:length(radioY)
chazhiY(i)=radioY(i)-hljcorsY(1);
for j=1:length(hljcorsY)
tempX=radioY(i)-hljcorsY(j);
if(abs(tempX)<abs(chazhiY(i)))
chazhiY(i)=tempX;
end
end
end
%%
%H方向
for i=1:length(radioH)
chazhiH(i)=radioH(i)-hljcorsH(1);
for j=1:length(hljcorsH)
tempX=radioH(i)-hljcorsH(j);
if(abs(tempX)<abs(chazhiH(i)))
chazhiH(i)=tempX;
end
end
end
%%
%大于1m的值,修改为NAN
chazhiX(abs(chazhiX)>1)=NaN;
chazhiY(abs(chazhiY)>1)=NaN;
chazhiH(abs(chazhiH)>2)=NaN;
%%
%绘图
hraw=figure;
figure(hraw);
subplot(3,1,1);
hold on;
plot(chazhiX,'red.');
%
figure(hraw);
subplot(3,1,2);
hold on;
plot(chazhiY,'red.');
%
figure(hraw);
subplot(3,1,3);
hold on;
plot(chazhiH,'red.');