Calling octave functions from oct-files

Carlo de Falco carlo.defalco at gmail.com
Thu Jan 17 07:32:23 CST 2008


On 17/gen/08, at 12:06, Carlo de Falco wrote:

> Hi,
> I am not really sure wether this is of any help,
> but you could have a look at the source code of the
> ODE/DAE solver functions which all can take function
> handles as an input, and then have to evaluate them repeatedly.
>
> for example I see (in src/DLD-FUNCTIONS/daspk.cc) things like
>
> daspk_fcn = c(0).function_value ();	
>
> that might be related to what you want to do.
> c.

Evan,
actually it seems to me that the attached code does what you intend  
to do.

 >> f=@(x) (x+pi)
f =

@(x) (x + pi)

 >> handletest(f,ones(3,1),3)
ans =

    10.425
    10.425
    10.425


I would be interested in knowing whether it gives any performance  
improvement
when applied to your case (I suspect not).
c.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: handletest.cc
Type: application/octet-stream
Size: 1367 bytes
Desc: not available
Url : https://www.cae.wisc.edu/pipermail/help-octave/attachments/20080117/09b4fc92/attachment.obj 


More information about the Help-octave mailing list