Path: news.mathworks.com!newsfeed-00.mathworks.com!news.tele.dk!feed118.news.tele.dk!feed116.news.tele.dk!bofh.vszbr.cz!news.radio.cz!newsreader4.netcologne.de!news.netcologne.de!feeds.phibee-telecom.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!gegeweb.org!aioe.org!.POSTED!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: The variable 'ClosePrice' appears to change in size on every
Date: Wed, 07 Nov 2012 09:21:16 -0600
Organization: Aioe.org NNTP Server
Lines: 23
Message-ID: <k7du6a$vg7$1@speranza.aioe.org>
References: <k794h3$es0$1@newscl01ah.mathworks.com> <k799j6$v17$1@speranza.aioe.org> <k7a71f$d98$1@newscl01ah.mathworks.com> <k7ccvs$bhk$1@speranza.aioe.org> <k7dt5g$3m6$1@newscl01ah.mathworks.com>
NNTP-Posting-Host: WYidXnbep3+33yLzC8wkOw.user.speranza.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20
X-Notice: Filtered by postfilter v. 0.8.2
Xref: news.mathworks.com comp.soft-sys.matlab:782235

On 11/7/2012 9:02 AM, Ryan wrote:

...[ PLEASE Do NOT toppost... :( ]...

...

> solutions. I got the same error. So, I looked at this even closer. It
> seems ‘JNJ’ is the offender. I took that out, and changed the # of times
> the loop runs: for i = 1:30

...

Which, of course, if you had done as suggested via debug earlier you 
would have discovered as well as if you looked at the results obtained 
you would know just what, specifically, _is_ the difference.

For the loop index use

i=1:length(array_name)

then don't have to count manually nor change code when list changes...

--