iteration only runs once.
Mostrar comentarios más antiguos
i have a part of the code that calls other functions until a parameter is true. To have a safety i put in a counter that can break out of the iteration if too many iterations don't give a result. I must do something wrong, because after one iteration the process stops, even wile in the workspace the papameter is still 0. Here is the part of my code
counter = 0;
for realpositiondetected = true
(call other functions)
counter = counter+1;
if counter >= 25
disp 'real position was not found in 25 iterations'
return
end
end
I don't have much programming experience, so i might be an easy fix i'm overlooking
Thanks Bert
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Environment and Settings en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!