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

조회 수: 4 (최근 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 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