"Animated" graph during cycle
1 回表示 (過去 30 日間)
古いコメントを表示
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
0 件のコメント
回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Reference Applications についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!