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

2 vues (au cours des 30 derniers jours)
Arianna Serpi
Arianna Serpi le 30 Mar 2017
Commenté : Star Strider le 2 Avr 2017
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?

Réponse acceptée

Star Strider
Star Strider le 30 Mar 2017
Set up a counter variable.
Example:
count = 0;
while -CONDITION-
-DO CALCULATIONS-
-UPDATE CONDITION VARIABLE-
count = count + 1;
end
  4 commentaires
Arianna Serpi
Arianna Serpi le 2 Avr 2017
thank you very much, i'm new in matlab and you have been very helpful for me
Star Strider
Star Strider le 2 Avr 2017
As always, my pleasure.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by