📄 pos3.m
字号:
%deltatheta对两站定位精度的影响
clear;clc;
M=10; %被测点数
N=100; %对每点的测量次数
x1=0,y1=0; %第一站坐标
x2=1000,y2=0; %第二站坐标
delta=0.001*(1:M);
theta1=pi/6;
theta2=-pi/6;
xt=1000*sin(theta1);
yt=1000*cos(theta2);
for (i=1:M)
%角度测得值
mtheta1(i,:)=theta1*ones(1,N)+delta(i)*randn(1,N);
mtheta2(i,:)=theta2*ones(1,N)+delta(i)*randn(1,N);
for(j=1:N)
%利用两站进行计算
xe2(i,j)=(y2-y1-cot(mtheta1(i,j))*x1+cot(mtheta2(i,j))*x2)/(cot(mtheta2(i,j))-cot(mtheta1(i,j)));
ye2(i,j)=(cot(mtheta2(i,j))*y1-cot(mtheta1(i,j))*y2-cot(mtheta1(i,j))*cot(mtheta2(i,j))*(x1-x2))/(cot(mtheta2(i,j))-cot(mtheta1(i,j)));
end
%计算均值和方差,并以均值作为最终测得坐标值
meanposx2(i)=mean(xe2(i,:));
meanposy2(i)=mean(ye2(i,:));
stdposx2(i)=std(xe2(i,:));
stdposy2(i)=std(ye2(i,:));
stdpos2(i)=(stdposx2(i)^2+stdposy2(i)^2)^1/2;
end
plot(delta,stdpos2);
xlabel('deltapi');
ylabel('E');
axis([0.001 0.01 0 200]);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -