From help-octave-request at bevo dot che dot wisc dot edu Mon Jun 9 03:24:18 2003 Subject: Re: Problem with Octave From: WJ Atsma To: octave-help-list Date: Mon, 9 Jun 2003 10:15:07 +0200 I think that works from the commandline, but not in a function file. Try putting your function definition in a string and call eval(function_string). If you have a recent version of octave you can also put subfunctions in a function file, so you would then have to change your script to a function and then below the testing function define the f function. Hope that helps. Willem Atsma On 2003.06.09 05:00 Fernando Cerda wrote: > Dear Sir, > > I am trying to run the following script in octave: > > # Integrate t^2 from t=1 to t=3 > function xdot = f (x, t) > xdot(1) = t ^ 2; > endfunction > x0=1; > t = linspace (0, 3, 10)'; > x = lsode ("f", x0, t) > plot(x,t) ------------------------------------------------------------- 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 -------------------------------------------------------------