How can I save the number of iterations in while loop?

2 ビュー (過去 30 日間)
Arianna Serpi
Arianna Serpi 2017 年 3 月 30 日
コメント済み: Star Strider 2017 年 4 月 2 日
I'm implementing a code to solve linear algebraic system with Gauss-Seidel algorithm. I need to save the number of iterations that are done by the while loop in the iterative process. how can i do?

採用された回答

Star Strider
Star Strider 2017 年 3 月 30 日
Set up a counter variable.
Example:
count = 0;
while -CONDITION-
-DO CALCULATIONS-
-UPDATE CONDITION VARIABLE-
count = count + 1;
end
  4 件のコメント
Arianna Serpi
Arianna Serpi 2017 年 4 月 2 日
thank you very much, i'm new in matlab and you have been very helpful for me
Star Strider
Star Strider 2017 年 4 月 2 日
As always, my pleasure.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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