I am not sure I have the syntax right on my while loop: And I am taking the absolute value with the abs command.
EA1 = pi / 4;
diff = 1;
while (abs(diff) > 0.000001)
diff = (EA1 - e * sin(EA1) - MA) / (1 + e * cos(EA1));
EA1 = EA1 + diff;
end

답변 (1개)

Walter Roberson
Walter Roberson 2015년 8월 28일

0 개 추천

That syntax is fine. You do not need the () around the condition but it does not hurt.

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

질문:

2015년 8월 28일

답변:

2015년 8월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by