What is the most compact form of a break?

Usually in a while loop 'if (...)', 'break', and 'end' goes to different lines, but I would like to use a compact form in one line, if possible.

 Accepted Answer

dpb
dpb on 7 Dec 2014
Edited: dpb on 7 Dec 2014
Then do so... :)
condition=false;
while ~feof(fid)
condition=somefunctionofsomthinghere;
if condition, break, end
...
end
I like the compact form for the purpose and write this as the above all the time, as well...

4 Comments

thanks! and comma is an equivalent form of a ; or a : ?
what is doc punct?
Type it and see... :)

Sign in to comment.

More Answers (0)

Categories

Find more on Large-Scale Modeling in Help Center and File Exchange

Asked:

on 7 Dec 2014

Commented:

dpb
on 18 Feb 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!