Why the ''break'' function does not work
3 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(2 个)
C.J. Harris
2012-11-14
Are you putting 'clear all' at the beginning of your scripts by any chance?
This will remove the breakpoints.
2 个评论
Jan
2012-11-14
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!