how to define an iteration number ?

24 visualizaciones (últimos 30 días)
Safia
Safia el 19 de Nov. de 2022
Comentada: Safia el 19 de Nov. de 2022
Hi all!
i'm trying to implement a program in matlab attached, i'm wondering how to define the number of iteration j?

Respuestas (1)

Torsten
Torsten el 19 de Nov. de 2022
The number of iterations is initialized as 0 :
i = 0;
Within the while loop, for each time the while loop is repeated, the number of iterations i is increased by 1:
i = i+1;
  14 comentarios
Torsten
Torsten el 19 de Nov. de 2022
I really don't understand the problem. If you save x in each of the iteration loops (maybe by overwriting a previous x), all would be fine, wouldn't it ?
Safia
Safia el 19 de Nov. de 2022
@Torsten the current x used will be replaced by the output result to do the calculation in next iteration.

Iniciar sesión para comentar.

Categorías

Más información sobre Solver Outputs and Iterative Display en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by