help-octave
[Top][All Lists]
Advanced

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

Re: definite integral of arbitrary function


From: rdurkacz
Subject: Re: definite integral of arbitrary function
Date: Sun, 13 May 2012 00:26:11 -0700 (PDT)

/You can vectorize the solution that was provided. ...

For example

function af = adiff(f)
   af = @(x) arrayfun (@(t)quad(f, 0, t), x);
endfunction
/

I will just mention that there is an inefficiency here. adiff() will now
call quad once for every point in the vector or series of arguments. More
specifically it will call for the integration of some function over a series
of intervlals, each one containing the previous one. In other words, each
invocation of quad will repeat the work of the previous one (and do a little
more). 
I have the feeling that it would be worthwhile writng vectorised quadxx
versions. 





--
View this message in context: 
http://octave.1599824.n4.nabble.com/definite-integral-of-arbitrary-function-tp4578474p4629734.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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