I am using Matlab to modify some code that will be used in a real time system. The real time system can't use 'break' or 'return' statements. I have a bunch of for loops in Matlab that use 'break' or 'return'.
This is an example:
for j = find(vec == 0)
   if A(j) == 1
      break;
   end
end
How do I get around using the 'break' statements?  I was told that I can use a 'while' loop instead.  however, I am trying to see if there are other ways.
This seems like it should be a basic question but I can't think of other solutions right now.
 
     
     
    