Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!p8g2000yqb.googlegroups.com!not-for-mail
From: Nathan <ngreco32@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: j not equal to i
Date: Fri, 22 Jan 2010 14:11:48 -0800 (PST)
Organization: http://groups.google.com
Lines: 17
Message-ID: <22859233-db71-4894-80ae-39773f92ea30@p8g2000yqb.googlegroups.com>
References: <hjck1s$25s$1@fred.mathworks.com> <2047bb41-198b-4a35-9003-bc68cc89418d@l11g2000yqb.googlegroups.com> 
	<32ce2567-140e-46f3-93c8-88c6df54643e@l11g2000yqb.googlegroups.com> 
	<hjd6pt$go1$1@fred.mathworks.com>
NNTP-Posting-Host: 198.206.219.33
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Trace: posting.google.com 1264198308 14317 127.0.0.1 (22 Jan 2010 22:11:48 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 22 Jan 2010 22:11:48 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: p8g2000yqb.googlegroups.com; posting-host=198.206.219.33; 
	posting-account=_KeVcAoAAAB7j3xn35ujaQ0BoQhuzwJP
User-Agent: G2/1.0
X-HTTP-Via: 1.1 wwwproxy-son-ca-01.ca.sandia.gov:80 (squid/2.5.STABLE14)
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) 
	Gecko/20091221 Firefox/3.5.7,gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:601034

Did you bother reading my post?

Do you need k to be a vector?
(What use is it as a vector, when it seems to only be used as a
counting variable?)

If you don't need it to be a vector, don't create it as a vector.
As I mentioned:
Instead of writing "k=1:N", replace that with "k=1". You won't have to
touch the "k=k+1".
Doing this will let your code iterate through the while loop, until k
finally reaches 100.
Note that doing this will make k a single element, not a vector of
multiple elements. This is what I think you are looking for.

-Nathan