MATLAb Integration

7 次查看(过去 30 天)
Jesus
Jesus 2011-4-19
Hello,
I am attempting to integrate a summation of functions over the intervals: (0 to x) and (x to Inf) using MATLAB. The integral is inside a “for” loop, and each function inside the integral is a function of x.
I began by using a separate integral for each interval, but I am wanting to know which MATLAB integration method should I use to integrate.
Please remember the integration is inside a “for” loop, and therefor will run many times; up to 500 times.

回答(2 个)

Walter Roberson
Walter Roberson 2011-4-19
Sounds like if possible you should use the symbolic toolbox outside the loop to calculate the general integral in the parameter, and then in the loop, subs() the current value of the parameter in to get the current integral; double() the symbolic number that results to get the double precision value.
  1 个评论
John
John 2011-7-7
Is there a way to symbolically integrate without the symbolic toolbox?

请先登录,再进行评论。


Mike Hosea
Mike Hosea 2011-7-8
Walter's suggestion of symbolic integration might work in some cases. Barring that, the only integration function that works on non-finite intervals is QUADGK, so that's the one you should use. Of course you could also do your own transform to a finite interval, but QUADGK is always the one you should try first, anyway.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by