[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Integrating a function with many arguments over one varible.
From: |
Billings, Paul |
Subject: |
RE: Integrating a function with many arguments over one varible. |
Date: |
Fri, 26 Aug 2005 10:09:19 -1000 |
It's a workaround, but you could define your single-variable function "on
the fly". Using atan2 as an example for the "real" function of 2 variables:
y = .5; % perhaps in a loop?
f1 = inline(sprintf('atan2(x,%f)', y));
quad(f,0,1)
Paul
-----Original Message-----
From: address@hidden [mailto:address@hidden
Sent: Friday, August 26, 2005 1:15 AM
To: address@hidden
Subject: Integrating a function with many arguments over one varible.
I need to find the integral of f(x, y1, ..., yn), over the variable x,
between 2 limits. I read that quadl in Matlab can do it simply, you only
have to add the values of the parameters y1, ..., yn at the end, when you
use quadl. I tried to do the same with quad in Octave, but it did not work.
I can't define "by hand" a function g(x) so that g(x) = f(x, y1, ..., yn),
and use quad with g(x), because in fact I need to find the values y1,...,yn
that minimize such quadrature along x.
Can someone help me?
Thank you.
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
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
-------------------------------------------------------------