快到碗里来 发表于 2013-11-8 15:09

MATLAB模拟搜索GPS卫星

GPS卫星能够精确导航必须保证用户能至少搜索到4颗卫星,做了一个小小的程序模拟一下,大家一起讨论,程序的不足之处:1、不能对24颗卫星编号;2、更重要的是不能固定24颗卫星的位置,程序中是随机出现的,这点有点不切实际。
clear all;clc
sosuo_time=0;
while sosuo_time<=50
staus=randi();
weixing_x=randi(,staus);
weixing_y=randi(,staus);
for ii=1:30;
    x1(ii)=15;
    x2(ii)=ii;
    y1(ii)=ii;
    y2(ii)=15;
end
plot(x1,y1,'r');
hold on
plot(x2,y2,'r');
t=-2*pi:0.01:2*pi;
cirl_x1=6*sin(t)+15;
cirl_y1=6*cos(t)+15;
plot(cirl_x1,cirl_y1,'b');
cirl_x2=12*sin(t)+15;
cirl_y2=12*cos(t)+15;
plot(cirl_x2,cirl_y2,'b');
text(15,28,'N')
text(15,2,'S')
text(2,15,'W')
text(28,15,'E')
for kk=1:staus
x=0.5*sin(t)+weixing_x(kk);
y=0.5*cos(t)+weixing_y(kk);
plot(x,y,'g');
end
pause(2);
hold off;
sosuo_time=sosuo_time+1;
end





陌上,烟雨遥 发表于 2013-11-10 19:11

赞楼主{:3_46:}

rory110 发表于 2013-11-14 12:59

看看,学习下……
页: [1]
查看完整版本: MATLAB模拟搜索GPS卫星