From help-request at octave dot org Mon Jan 31 02:41:44 2005 Subject: Re: error:expecting integer index From: Gerald Ebberink To: help at octave dot org Date: Mon, 31 Jan 2005 09:45:13 +0100 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 try x=[-pi:0.01:pi] David S. Brown wrote: | Hi, | | I am trying to do something similar to the following | but get the error: | | GNU Octave, version 2.1.57 (i386-pc-linux-gnu). | | octave:1> fn = input(' ','s'); | sin(x) | octave:2> f2 = inline(fn); | octave:3> x=-pi:.01:pi; | octave:4> y=f2(x); | error: expecting integer index, found -3.141593 | error: evaluating assignment expression near line 4, | column 2 | | so as I understand, it and I want x(1) to equal -pi | but instead it is doing x(-pi). How do I write this | so it is indexing x(1) trough length(x)? | | Thanks, | Dave | | | | | __________________________________ | Do you Yahoo!? | The all-new My Yahoo! - What will yours do? | http://my.yahoo.com | | | | ------------------------------------------------------------- | 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 | ------------------------------------------------------------- | -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFB/fAZbSbfYz8yWIMRAleXAKDOf5ezGRYD4nThCcayRkV0BxEfEwCg1RQ7 dWQ8k3vCPcH9nA66FAfLzmQ= =5px4 -----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 -------------------------------------------------------------