フィルターのクリア

Syntax a while loop

2 ビュー (過去 30 日間)
Philosophaie
Philosophaie 2015 年 8 月 28 日
回答済み: Walter Roberson 2015 年 8 月 28 日
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 日
That syntax is fine. You do not need the () around the condition but it does not hurt.

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by