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

2 visualizaciones (últimos 30 días)
Arianna Serpi
Arianna Serpi el 30 de Mzo. de 2017
Comentada: Star Strider el 2 de Abr. de 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?

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by