How to get out of the for cycle and start all over again?

1 visualizzazione (ultimi 30 giorni)
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:
P_matlab.png

Risposta accettata

Walter Roberson
Walter Roberson il 19 Ott 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

Più risposte (0)

Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by