Grupuri Google nu mai acceptă postările sau abonamentele noi Usenet. Conținutul anterior este în continuare vizibil.

Integration

0 afișări
Accesați primul mesaj necitit

Surbhi Razdan

necitită,
7 apr. 2010, 03:33:0807.04.2010
How can integration over a discetre interval be done using MATLAB?

Torsten Hennig

necitită,
7 apr. 2010, 06:45:2307.04.2010
> How can integration over a discetre interval be done
> e using MATLAB?

What is 'integration over a _discrete_ interval' ?

Best wishes
Torsten.

Steven Lord

necitită,
7 apr. 2010, 09:49:1307.04.2010

"Surbhi Razdan" <surbh...@gmail.com> wrote in message
news:hphcfk$o1m$1...@fred.mathworks.com...

> How can integration over a discetre interval be done using MATLAB?

If you mean you want to integrate a function numerically over a finite
interval, use QUADGK, QUAD, or QUADL.

If you mean you want to integrate a function numerically over a 2D or 3D
region look at QUAD2D, DBLQUAD, or TRIPLEQUAD.

If you want to integrate a function symbolically and have Symbolic Math
Toolbox available, use INT.

If you just have data representing the values of a function at certain
locations in your interval, use TRAPZ.

If you mean something else, please clarify what you're looking to do.

--
Steve Lord
sl...@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ


nordmoon

necitită,
12 apr. 2010, 11:33:3412.04.2010
I have an plot representing measured spectra, is there a way to get the integrated area for one line? If so, how?
(There is no equation representing this measured spectra)

Thanks!

Bradley

necitită,
29 apr. 2010, 18:40:0729.04.2010
"Steven Lord" <sl...@mathworks.com> wrote in message <hpi2fu$b3k$1...@fred.mathworks.com>...

Further to this...

How would it be possible to compute a double integral with a variable lower limit on the inner integral but with infinite upper limits, given that quad2d does not accept infinite limits?

Specifically, the integrand is a function of a and h;

y = @(a,h) a*lognpdf(a,mu_a,sigma_a)*lognpdf(h,mu_h,sigma_h)

and the inner limits are f(h) and inf, where f is some (simple linear) function of h, and the outer limits are (b,inf). So after specifying f(h), I *would like* to write

quad2d(@(a,h) a.*lognpdf(a,mu_a,sigma_a).*lognpdf(h,mu_h,sigma_h),f(h),inf,b,inf)

but cannot because the limits must be finite.

The alternative method I've tried is to use the "int" function to do the double integral after having declared a and h as symbolic variables. (The lognormal distributions must be written out explicitly because MATLAB does not appear to accept symbolic inputs to the distribution functions.) But MATLAB cannot find an explicit integral and neither can it convert the result through the "double" function.

Thanks for any help.

0 mesaje noi