Why the ''break'' function does not work

3 visualizaciones (últimos 30 días)
Milen
Milen el 14 de Nov. de 2012
Hello,
I have somtimes an issue when usung the 'break' function to stop the exsecution of a for loop when some sondition is achieved. Sometimes it works but sometimes it does not work and I wonder why? My be I am making some mistake.
Does anyone experienced similar issue? Do you know how to fix it?
Thank you!
Milen

Respuestas (2)

C.J. Harris
C.J. Harris el 14 de Nov. de 2012
Are you putting 'clear all' at the beginning of your scripts by any chance?
This will remove the breakpoints.
  2 comentarios
Ilham Hardy
Ilham Hardy el 14 de Nov. de 2012
The function
break
is not similar as breakpoints
Jan
Jan el 14 de Nov. de 2012
As far as I understand, Milen asks for the "break" command, not for breakpoints.

Iniciar sesión para comentar.


Jan
Jan el 14 de Nov. de 2012
Yes, I agree that your code contains a mistake.
Matlab is a deterministic system. When the condition is met, the corresponding code is executed. If you post the code, we could search for the problem. Without seeing the code, there is no chance to guess what's going on.
  1 comentario
Milen
Milen el 15 de Nov. de 2012
Thanks everybody for the feedbacks!

Iniciar sesión para comentar.

Categorías

Más información sobre Loops and Conditional Statements 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