gps_satellite_positions.m

来自「推算GPS卫星24小时内的位置」· M 代码 · 共 40 行

M
40
字号
wie=0;% 0->ECEF;1->ECI.

load s1eph;
sat_id_ehp=zeros(1,32);
sat_firsttime_record=zeros(1,32);
h=waitbar(0,'calculation of the 24h-arcs of the satellites');
for j=1:((length(s1eph))/24)
   if sat_id_ehp(1,s1eph(24*(j-1)+1))==1
       continue;
   else
       sat_id_ehp(1,s1eph(24*(j-1)+1))=1;
   end
   sat_firsttime_record(1,s1eph(24*(j-1)+1))=s1eph(24*(j-1)+2);
   for i=1:(24*6)
   [x(i,s1eph(24*(j-1)+1)),y(i,s1eph(24*(j-1)+1)),z(i,s1eph(24*(j-1)+1)),tsat(i,s1eph(24*(j-1)+1)),rela(i,s1eph(24*(j-1)+1))]=eph2xyzn(-600+i*600,0,s1eph((j*24-23):(j*24)),wie);
    end
waitbar(j/((length(s1eph))/24));   
end
close(h);

figure;
title('GPS-Orbits in chosen system');
xlabel('meter');
ylabel('meter');
zlabel('meter');
plot3(x,y,z);
view(3);
axis equal;
%box;
%colormap('gray');
%colormap('white');
colormap('summer');
hold on;
[a,b,c]=sphere(18);
surfl(a*6380000,b*6380000,c*6380000,[0,-23]);
hold off;
grid on;


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?