How to utilise the MATLAB debugger mode to initialise a random iteration in a FOR loop ?
Show older comments
Hi there,
Just imagine that I have a for loop in a code as show below.
for count = 1 : 100
do something
end
I have found that there is something wrong with my code (a logical error) at the 31st iteration.
So If I am using the debugger mode in MATLAB, I should add a breakpoint at the beginning and the end of the for loop to go through each step and see what is happening inside my code. The problem I have there is, should I always start iterating the for loop from
count =1
Instead can I start with count = 27 or somewhere closer so I it would easier my debugging ?
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!