File Exchange

image thumbnail

Integrate (wrapper for dealing with infinite bounds)

version 1.0.1.0 (1.68 KB) by AS
A wrapper for quad to deal with inf bounds.

1 Download

Updated 31 Mar 2016

View Version History

View License

A wrapper for quad (or any other integration function) to deal with infinite bounds.
This basically does the transformations for you to do improper integrals. For example, what this does is:

int(f(x), 1, inf) = int( (1/x^2) f(1/x), 0, 1)

For example, if I wanted the integral of exp(-x^2) from 0 to infinity, I would just enter:
integrate(@(x)exp(-x.^2),0,inf)

And this function would do the rest of the work.

Cite As

AS (2021). Integrate (wrapper for dealing with infinite bounds) (https://www.mathworks.com/matlabcentral/fileexchange/21417-integrate-wrapper-for-dealing-with-infinite-bounds), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)

Serge

John D'Errico

I was tempted to rate this lower, but it is an interesting code, transforming definite integrals over infinite domains to more manageable problems.

It fails in its help, which is poor. I found an inadequate description of the parameters. I found only limited error checks. I found no examples of use. I did find a superfluous number of %%%% symbols. The author might have spent more time on the help, and less effort holding his finger down on the % key.

The H1 line was missing. What is an H1 line? It is the very first line of the help block in your function. It enables the lookfor functionality in matlab. The author apparently has never looked closely at the help blocks for the codes that come from the MathWorks. When someone wants to remember the name of your function next year, how will they find it? They might try to use lookfor, but it will find nothing from this code.

I wanted to rate this as a 2.5.

MATLAB Release Compatibility
Created with R2007a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!