Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!p23g2000prp.googlegroups.com!not-for-mail
From: Andrew <andrewkgentile@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Subscript indices
Date: Tue, 17 Feb 2009 06:23:52 -0800 (PST)
Organization: http://groups.google.com
Lines: 44
Message-ID: <6c11dd6f-835c-4e58-8a1f-11aa63f13471@p23g2000prp.googlegroups.com>
References: <gne9b2$46o$1@fred.mathworks.com> <gnearq$hnu$1@fred.mathworks.com> 
	<gnecam$1jv$1@fred.mathworks.com> <gnecnq$sg5$1@fred.mathworks.com>
NNTP-Posting-Host: 192.251.23.2
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1234880633 8300 127.0.0.1 (17 Feb 2009 14:23:53 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 17 Feb 2009 14:23:53 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: p23g2000prp.googlegroups.com; posting-host=192.251.23.2; 
	posting-account=0QzK9QoAAAASked1gGMxOrY40XaDDtFq
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6) 
	Gecko/2009011913 Firefox/3.0.6,gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:518842


On Feb 17, 6:06=A0am, "Jos " <#10...@fileexchange.com> wrote:
> "S?bastien Vilaseca" <seb2...@bluewin.ch> wrote in message <gnecam$1j...@=
fred.mathworks.com>...
> > "Jos " <#10...@fileexchange.com> wrote in message <gnearq$hn...@fred.ma=
thworks.com>...
> > > "S?bastien Vilaseca" <seb2...@bluewin.ch> wrote in message <gne9b2$46=
...@fred.mathworks.com>...
> > > > Hi,
> > > > I have the following loop:
>
> > > > for x=3D[0.001:0.001:0.1]
> > > > result(x)=3Dy;
> > > > end
>
> > > > The problem is that I get the following error message: "Subscript i=
ndices must either be real positive integers or logicals". So is there a wa=
y I can make it without that error?
>
> > > What is "it" in ".. so I can make it ..."?
>
> > > Jos
>
> > So I can find the solution :).
>
> Sure! But which solution?
>
> What should your solution look like? In other words, what is "it"?
>
> "The largest part of the answer is in asking the right question"
>
> Jos

"Indices" refers to the numbering system matlab uses to access each
element of an array.  If you have an array: x=3D[1, 2, 1, 4, 6, 5, 7];
you can see that there are 7 elements in the array.  So, x(1) is the
first element, and x(7) is the 7th element.  If you asked for x(8),
you would get an error because the array doesn't have 8 elements.  And
if you asked for x(0.1) you would get an error because there cannot be
a non integer index value used to reference one of the elements of the
array.

On the other hand, if you had the array x =3D [0.001:0.001:1] and you
asked for x(1), you would get the value at x(1) which is 0.001, and x
(2) would be 0.002...etc.