Prova a dare un'occhiata a quanto segue.
Ho anche semplificato un po' il codice che hai scritto:
terra=load('terra.txt');
ast=load('ast.txt');
sat=load('sat.txt');
% Orbita Terra
xT=terra(:,2).*cosd(terra(:,3)).*cosd(terra(:,4)); % r*cos(theta)*cos(phi)
yT=terra(:,2).*sind(terra(:,3)).*cosd(terra(:,4)); % r*sin(theta)*cos(phi)
zT=terra(:,2).*sind(terra(:,4)); % r*sin(phi)
% Orbita asteroide
xA=ast(:,2).*cosd(ast(:,3)).*cosd(ast(:,4));
yA=ast(:,2).*sind(ast(:,3)).*cosd(ast(:,4));
zA=ast(:,2).*sind(ast(:,4));
% Orbita satellite
xsat=sat(:,1).*cosd(sat(:,2)).*cosd(sat(:,3));
ysat=sat(:,1).*sind(sat(:,2)).*cosd(sat(:,3));
zsat=sat(:,1).*sind(sat(:,3));
figure(1)
plot3(xT,yT,zT,'b','linewidth',2,xA,yA,zA,'k','linewidth',2,xsat,ysat,zsat,'r','linewidth',2)
%daspect([1 1 1])
grid minor
hold on
for i=1:length(xT)
hp(1)=plot3(xT(i),yT(i),zT(i),'o','markerfacecolor','b','markeredgecolor','b','markersize',13);
hp(2)=plot3(xA(i),yA(i),zA(i),'o','markerfacecolor','k','markeredgecolor','k','markersize',13);
hp(3)=plot3(xsat(i),ysat(i),zsat(i),'o','markerfacecolor','r','markeredgecolor','r','markersize',13);
pause(0.3)
delete(hp(:))
end
Togli il commento alla riga "%daspect([1 1 1])" se vuoi che i tre assi abbbiano lo stesso aspect ratio.