Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!w5g2000vbv.googlegroups.com!not-for-mail
From: Greg Heath <g.heath@verizon.net>
Newsgroups: comp.soft-sys.matlab
Subject: Re: using loops, need number to be an odd integer
Date: Mon, 19 Mar 2012 12:25:21 -0700 (PDT)
Organization: http://groups.google.com
Lines: 23
Message-ID: <7bea18d3-c991-4350-a03d-a47c0bc4d473@w5g2000vbv.googlegroups.com>
References: <jk5oc2$e0m$1@newscl01ah.mathworks.com> <jk5qfi$jhu$1@newscl01ah.mathworks.com>
 <jk6k13$sto$1@newscl01ah.mathworks.com> <jk6ke6$s7$1@newscl01ah.mathworks.com>
NNTP-Posting-Host: 166.248.39.210
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1332185121 25896 127.0.0.1 (19 Mar 2012 19:25:21 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 19 Mar 2012 19:25:21 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: w5g2000vbv.googlegroups.com; posting-host=166.248.39.210; posting-account=eN66xwoAAACcrVy_A6ukr6atsHzaxk64
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64;
 Trident/5.0; NP06),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:761499

On Mar 19, 2:41 am, "Matt J " <mattjacREM...@THISieee.spam> wrote:
> "Matt J" wrote in message <jk6k13$st...@newscl01ah.mathworks.com>...
> > Another possibility
>
> > n = 11;
> > while sqrt(n)<132
> >  n = n+22;
> > end
>
> =============
>
> I missed the requirement that the loop start at n=1. Here's a modification to include it,
>
> n = 1;
> while sqrt(n)<132
>  if n==1,
>      n=11;
>  else
>      n=n+22;
>  end
> end