How to get out of the for cycle and start all over again?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Simone Fratton
el 19 de Oct. de 2019
Comentada: Walter Roberson
el 20 de Oct. de 2019
Good morning,
first of all I apologize for my poor English, however:
I have to run a matlab program already done, this program is given some inputs (a = 1, B = 2 ...), then I with an if cycle check if the results are good. If the results are not good I want you to update the inputs (for example put a = a + 1 etc.) and then go back to the lines of the previous program to redo the calculations again. What I can't do is go back to a previous line in the program. Can someone help me?
To get a better understanding of what the problem is, I will give an example:
0 comentarios
Respuesta aceptada
Walter Roberson
el 19 de Oct. de 2019
a = 1;
while true
B = a*23+54 ;
if B < 89
a = a+1;
continue;
end
end
Or more cleanly,
a = 1;
B = a*23+54 ;
while B < 89
a = a + 1;
B = a*23+54 ;
end
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre 2-D and 3-D Plots 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!