Path: news.mathworks.com!not-for-mail
From: "Bryan " <bdg146.removeThis@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: do while
Date: Thu, 15 May 2008 14:52:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 14
Message-ID: <g0himi$egf$1@fred.mathworks.com>
References: <g0gt2m$h3q$1@fred.mathworks.com>
Reply-To: "Bryan " <bdg146.removeThis@gmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1210863122 14863 172.30.248.37 (15 May 2008 14:52:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 15 May 2008 14:52:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1377572
Xref: news.mathworks.com comp.soft-sys.matlab:468610


Couldn't you also just do the following:

%execute commands

while (test)
  %execute commands
end

By executing the code first outside the while loop, you're 
ensuring that it gets executed once even if test is never 
true, just as a do-while loop will do.  You'll probably 
have to change the (test) part of the loop a bit, but you 
should be able to get the functionality you want with a 
simple while loop.