From: Etienne G. <et...@is...> - 2002-08-10 17:27:51
|
Hello again, On Sat, Aug 10, 2002 at 01:32:42PM +0000, Steffan Berridge wrote: #=20 # Hi, #=20 # I have just started using Octave, having used Matlab for a # while. In Matlab I have often used inline functions, they # are very convenient for example when passing a function as # an argument. #=20 # For example, the following is a function returning the # square of the argument: #=20 # fun =3D inline('x^2','x'); Try the attached m-file, called inline.m. Is that, or something alike, worthy of octave-forge? Cheers, Etienne =20 # One can then pass this function as an argument to another # function: #=20 # x =3D foo(fun,...); #=20 # So my question is, is there an equivalent construction in # Octave? If not, what is the best way to pass functions as # arguments? #=20 # Thanks, # Steffan #=20 #=20 #=20 #=20 # ------------------------------------------------------------- # Octave is freely available under the terms of the GNU GPL. #=20 # 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 # ------------------------------------------------------------- #=20 #=20 #=20 #=20 # =00=00=00=00=00=00=00=00=00 --=20 Etienne Grossmann ------ http://www.isr.ist.utl.pt/~etienne |