help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calling octave functions from oct-files


From: Carlo de Falco
Subject: Re: Calling octave functions from oct-files
Date: Thu, 17 Jan 2008 13:32:23 +0000


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.

Attachment: handletest.cc
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]