Exit infinite loop in script via expression
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi, is there a way to basically detect an infinite loop and stop it within a script programmatically? Let's say you had a vector, an a while loop which with a function puts a random number in the vector if there's space i.e. m(x, y) == 0. With the condition of the while loop being:
while (m(rrn, rcn) ~= 0)
where 'm' is the vector, 'rrn' is the 'random row number' etc.
1 Kommentar
Jan
am 23 Apr. 2014
The example is not clear to me. Why is this an infinite loop? As long as this is not clear, detecting such cases programmatically is impossible.
Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!