No BSD License  

Highlights from
SIMPSUM

2.0

2.0 | 1 rating Rate this file 2 Downloads (last 30 days) File Size: 1.27 KB File ID: #5721

SIMPSUM

by Vassili Pastushenko

 

17 Aug 2004 (Updated 19 Aug 2004)

Next to TRAPZ should be SIMPSON integration.

| Watch this File

File Information
Description

If you want to integrate numerically an analytical function, you can use QUAD or similar. However, if you want to integrate already sampled data (equidistantly), and if the data are sufficiently smooth, instead of TRAPZ you will prefer SIMPSUM, numerical integration by Simpson method. It works on vectors and matrices (columnwise), calculates the average value of the sampled data, or simpson integral itself, if you supply the range(s) of independent variable(s). If you have nonequally spaced, but still smooth data, you can first resample them equidistantly with the help of some interpolation program like interp1(...'spline') and then apply SIMPSUM.

Acknowledgements
This submission has inspired the following:
CUMSIMPSUM
MATLAB release MATLAB 6.5.1 (R13SP1)
Other requirements None
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
28 Mar 2006 Luka Rahne

Omg, this algorithm is wrong!!!!
try for
simpsum([1,0,1,4,9],1)

it return 2.333

29 Mar 2006 Vassili Pastushenko

I was not able to find such an ML expert as Luka Rahne neither in FEX nor in RSS.

"Luka Rahne", if you are convinced that you are an ML expert, you have to prove your statement. SIMPSUM gave you a correct answer. Why do you think that SIMPSUM mistakes?

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
integration Vassili Pastushenko 22 Oct 2008 07:30:13
numerical Vassili Pastushenko 22 Oct 2008 07:30:13
simpson Vassili Pastushenko 22 Oct 2008 07:30:13
mathematics Vassili Pastushenko 22 Oct 2008 07:30:13

Contact us at files@mathworks.com