This link illustrates that we should use endfor statement to close the scope of for loop.
But replacing it with end results into the same behavior.
Does using end rather than endfor have any unexpected side effects?
end is synonymous with endfor when closing a for loop.
The only side effect of using end is that your code will also be compatible with MATLAB, as endfor is an extension of the language invented by Octave. I recommend that you do not use endfor and the like (endif, endfunction, endswitch, endwhile).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With