Plotting the tragectory in MATLAB

조회 수: 2 (최근 30일)
james flynn
james flynn 2017년 3월 6일
편집: james flynn 2017년 3월 9일
.

채택된 답변

James Tursa
James Tursa 2017년 3월 6일
In your Gravity function you have some variable name inconsistencies. E.g.,
function dRV = Gravity(t, RV)
global T X_J Y_J Z_J X_M Y_M Z_M X_E Y_E Z_E mu_E mu_M mu_J mu_S
X = R(1);
Y = R(2);
Z = R(3);
VX = R(4);
VY = R(5);
VZ = R(6);
:
dR(1) = VX
dR(2) = VY
dR(3) = VZ
dR(4) = dV * X
dR(5) = dV * Y
dR(6) = dV * Z
So, you pass in a variable named RV, but then access it using the variable name R. And your output variable is named dRV in the function line, but you use the name dR in your code. You need to pick consistent variable naming for these.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by