Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#46 numerical integration by Simpson's rule

open
nobody
None
5
2013-05-12
2013-05-12
israel
No

The attached file is a function that numerically integrates any given anonymous function (fx), using Simpson's rule, which is more accurate than the trapeziodal rule (accuracy: dx^4), it includes an explicit help
Example:
integrate the function 1/x between 1 and 2
using 30 intervals gives as a result 0.693147 ( the exact value is the same up to 6 places)
the m-function call is:
Outp=simpson_integ(fx),
where fx=@x 1./x for the example above, the rest of the inputs are asked for on-line

Discussion

  • israel
    israel
    2013-05-12

    numerical integration by Simpson's rule

     
    Attachments