[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Function-pointer - function as argument for functions
From: |
Christian Zobel |
Subject: |
Re: Function-pointer - function as argument for functions |
Date: |
Thu, 27 Apr 2000 19:36:52 +0200 (MEST) |
On Wed, 26 Apr 2000, Etienne Grossmann wrote:
> you can do it with :
>
> function retval = fun10( funname )
>
> retval = feval( funname , 10 ) ;
> ## or,
> ## retval = eval(sprintf("%s(10);",funname)) ;
> ## or
> ## eval(["retval = ",funname,"(10);"]) ;
>
> end
Thanks a lot! (I think I have to read the manual a little more intense! :)
...but can you also use this with mathematic expressions like "x**2"?! Or
do I first have to write something like
function retval = quad ( arg )
retval = arg**2
endfunction
and then use quad instead of "x**2"?
Christian
--
Christian Zobel *** address@hidden *** +49-221-470-2911/3604
-----------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.che.wisc.edu/octave/octave.html
How to fund new projects: http://www.che.wisc.edu/octave/funding.html
Subscription information: http://www.che.wisc.edu/octave/archive.html
-----------------------------------------------------------------------