Borrar filtros
Borrar filtros

"Animated" graph during cycle

1 visualización (últimos 30 días)
Ludovico Soldati
Ludovico Soldati el 1 de Jun. de 2015
Respondida: Walter Roberson el 1 de Jun. de 2015
Hi everybody, I've got a problem I'm trying to plot a particular orbit of a satellite during a while cycle, but Matlab collects all the data and plot them at the end of the cycle. I don't know if the mistake I made is in the structure of the cycle or in the formulas, but it takes an infinity of time and at the end it shows, in the graph, an infinity of wrong lines :P
The code I'm using is this one, there is already the graph of the Earth existing
while Rmbt ~= Rmtar
Rtar = [Rmtar * cos(theta2) Rmtar * sin(theta2)];
Rmbt = at * (1 - ebt^2) / (1 + ebt * cos(theta1));
Rbt = [Rmbt * cos(theta1) Rmbt * sin(theta1)];
theta1 = theta1 + 1;
theta2 = theta2 + 1;
plot (Rtar(1), Rtar(2), 'r')
hold
plot (Rbt(1), Rbt(2), 'b')
hold all
end
where Rmbt is the "moving" trajectory and Rmtar is the target trajectory, they are the radius bi-dimensional vectors of the satellites, while "theta1/2" are the angles
-----------
I'd like to see the orbit that evolves in time reaching the second one.
Thank you all

Respuestas (1)

Walter Roberson
Walter Roberson el 1 de Jun. de 2015

Categorías

Más información sobre Earth and Planetary Science en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by