help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Invalid index error


From: Geraint Paul Bevan
Subject: Re: Invalid index error
Date: Sun, 01 Aug 2004 23:53:20 +0100
User-agent: Mozilla Thunderbird 0.5 (X11/20040306)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rich Shepard wrote:

|
|>To use the for loop, you just need to change (i+1) to (i):
|
|
| Geraint,
|
|   Ah! I knew I couldn't start with 0 but there had to be a way.
|
|

Just to clarify slightly, the "for" command in Octave loops over each of
the list elements (remember that [1:6] expands to [1 2 3 4 5 6]) so
there is no need to increment the counter as you would in other
languages such as C or Fortran.

|
|
|   Kewel! Do I page through the manual to find these gems? The index is
| rather sparse.
|
| Again, many thanks,
|
| Rich
|

I've always though the manual index was fairly comprehensive. Anyway,
assuming that you are using info to view the manual (I think you said
that you use emacs), you can get to the right spot by searching for
"product" - it will take you to the "Sums and Products" node in the
"Arithmetic" section.

The function index is also a pretty useful place to search for relevant
terms. Of course, familiarity with the manual helps, as does subscribing
to this list.

- --
Geraint Bevan
http://homepage.ntlworld.com/geraint.bevan

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iEYEARECAAYFAkENdF8ACgkQcXV3N50QmNPnXACcCFl/9DNKJz8b2l9lqUZp7SnJ
YkAAoI5SlFGb6+lBkZituvW3eearSbkY
=7Hn1
-----END PGP SIGNATURE-----



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]