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

4 次查看(过去 30 天)
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

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by