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?
0 个评论
采纳的回答
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!