Since R2015b, Matlab errors on `break` and `continue` statements in scripts that don't contain the corresponding loop. To support this we'll have to transform loop code, removing `break` and `continue` in favor of flags and conditional statements.