From: Nathan <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: j not equal to i
Date: Fri, 22 Jan 2010 14:11:48 -0800 (PST)
Lines: 17
Message-ID: <>
References: <hjck1s$25s$> <> 
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Trace: 1264198308 14317 (22 Jan 2010 22:11:48 GMT)
NNTP-Posting-Date: Fri, 22 Jan 2010 22:11:48 +0000 (UTC)
Injection-Info:; posting-host=; 
User-Agent: G2/1.0
X-HTTP-Via: 1.1 (squid/2.5.STABLE14)
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: 
	Gecko/20091221 Firefox/3.5.7,gzip(gfe),gzip(gfe)
Xref: 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.