From help-request at octave dot org Mon Jan 31 02:27:27 2005 Subject: Re: error:expecting integer index From: David Bateman To: "David S. Brown" Cc: help at octave dot org Date: Mon, 31 Jan 2005 09:28:01 +0100 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 > > Get 2.1.64, where inline functions are implemented in the core of octave octave:1> fn = input(' ','s'); sin(x) octave:2> f2 = inline(fn) f2 = f(x) = sin(x) octave:3> x=-pi:.01:pi; octave:4> y=f2(x); octave:5> version ans = 2.1.64 -- David Bateman David dot Bateman at motorola dot com Motorola CRM +33 1 69 35 48 04 (Ph) Parc Les Algorithmes, Commune de St Aubin +33 1 69 35 77 01 (Fax) 91193 Gif-Sur-Yvette FRANCE The information contained in this communication has been classified as: [x] General Business Information [ ] Motorola Internal Use Only [ ] Motorola Confidential Proprietary ------------------------------------------------------------- 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 -------------------------------------------------------------