Home > By category > Scripts >Development Tools > Simpson's 1/3 and 3/8 rules

Simpson's 1/3 and 3/8 rules

  • Downloads: 
  • Views: 
  • Rating:

SIMPSON: Simpson's rule for quadratic and cubic numerical integration
RES = SIMPSON(Y) computes an approximation of the integral of Y via
Simpson's 1/3 rule (with unit spacing). Simpson's 1/3 rule uses
quadratic interpolants for numerical integration. To compute the
integral for spacing different from one, multiply RES by the spacing

For vectors, SIMPSON(Y) is the integral of Y. For matrices, SIMPSON(Y)
is a row vector with the integral over each column. For N-D
arrays, SIMPSON(Y) works across the first non-singleton dimension.

RES = SIMPSON(X,Y) computes the integral of Y with respect to X using
Simpson's 1/3 rule. X and Y must be vectors of the same
length, or X must be a column vector and Y an array whose first
non-singleton dimension is length(X). SIMPSON operates along this
dimension. Note that X must be equally spaced for proper execution of
the 1/3 and 3/8 rules. If X is not equally spaced, the trapezoid rule
(MATLAB's TRAPZ) is recommended.

RES = SIMPSON(X,Y,DIM) or SIMPSON(Y,DIM) integrates across dimension
DIM of Y. The length of X must be the same as size(Y,DIM)).

RES = SIMPSON(X,Y,DIM,RULE) can be used to toggle between Simpson's 1/3
rule and Simpson's 3/8 rule. Simpson's 3/8 rule uses cubic interpolants
to accomplish the numerical integration. If the default value for DIM
is desired, assign an empty matrix.

- RULE options

[DEFAULT] '1/3' Simpson's rule for quadratic interpolants

'3/8' Simpson's rule for cubic interpolants

% Integrate Y = SIN(X)
x = 0:0.2:pi;
y = sin(x);
a = sum(y)*0.2; % Rectangle rule
b = trapz(x,y); % Trapezoid rule
c = simpson(x,y,[],'1/3'); % Simpson's 1/3 rule
d = simpson(x,y,[],'3/8'); % Simpson's 3/8 rule
e = cos(x(1))-cos(x(end)); % Actual integral
fprintf('Rectangle Rule: %.15fn', a)
fprintf('Trapezoid Rule: %.15fn', b)
fprintf('Simpson''s 1/3 Rule: %.15fn', c)
fprintf('Simpson''s 3/8 Rule: %.15fn', d)
fprintf('Actual Integral: %.15fn', e)

% http://math.fullerton.edu/mathews/n2003/simpson38rule/Simpson38RuleMod/Links/Simpson38RuleMod_lnk_2.html
x1 = linspace(0,2,4);
x2 = linspace(0,2,7);
x4 = linspace(0,2,13);
y = @(x) 2+cos(2*sqrt(x));
format long
y1 = y(x1); res1 = simpson(x1,y1,[],'3/8'); disp(res1)
y2 = y(x2); res2 = simpson(x2,y2,[],'3/8'); disp(res2)
y4 = y(x4); res4 = simpson(x4,y4,[],'3/8'); disp(res4)

Class support for inputs X, Y:
float: double, single

See also sum, cumsum, trapz, cumtrapz.

Free download from Shareware Connection - SIMPSON: Simpson's rule for quadratic and cubic numerical integration

Publisher: Jered Wells | License: Shareware
Version: 1.0 | Size: 10 KB | Platform: Matlab, Scripts
Released Date: 27-06-2013 | Rating: 0 | Title: Simpson's 1/3 and 3/8 rules

Author Url: http://www.mathworks.com
Program Info Url: http://www.mathworks.com
Download Url: http://www.mathworks.com/matlabcentral/fx_files/33493/3/simpson.zip

More downloads from Simpson's 1/3 and 3/8 rules publisher Jered Wells:

OrthoView3D - MATLAB GUI for exploring 3D datasets through a sleek and simple interface (sample dataset included)

lorentzfit3 - LORENTZFIT3 fits a three parameter Lorentzian model to data (LORENTZVAL3 included in download)

lorentzfit1 - a = lorentzfit1(x,y,a0) LORENTZFIT1 fits the input Y(X) with a Lorentzian function of the form Y'(X) = 1./(A(X.^2 + 1)) (i.e. 1-parameter model).

R-square: The coefficient of determination - r2 = rsquare(y,f) RSQUARE computes the coefficient of determination (R-square) value from actual data Y and model data F. INPUTS Y : Actual data F : Model fit OUTPUT R2 : Coefficient of determination EXAMPLE x = 0:0.1:10; y = 2.

Simpson's 1/3 and 3/8 rules keywords:
Simpson's 1/3 and 3/8 rules related downloads:

Simpson's Rule Integration - This function computes the integral "I" via Simpson's rule in the interval [a,b] with n+1 equally spaced points

MVSP (Multi-Variate Statistical Package) - MVSP is an inexpensive and easy to use program that performs a number of multivariate numerical analyses useful in many scientific fields.

SIMPSUM - If you want to integrate numerically an analytical function, you can use QUAD or similar.

GuitarTuna - Best Guitar Tuner - GuitarTuna is the easiest, fastest and most accurate free guitar tuner app out there!We noticed most of free tuner apps suck so we made one that doesn't:* Simple and easy to use - no fuss, clean interface'* Now with option to buy different...

Comparison analysis of numerical intergration methods - Comparison analysis of numerical intergration methods, viz

Shareware Connection periodically updates pricing and software information of 'Simpson's 1/3 and 3/8 rules' from company source 'Jered Wells' , so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft,  Using 'Simpson's 1/3 and 3/8 rules' crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Simpson's 1/3 and 3/8 rules.

New Reviews

SnapCrab - Nearly every PC users need to take screenshots from time to time, whether it is for personal or professional needs. While using the basic Windows screenshot capture method is available, it is not adequate for everyone. When you want to capture ...

SeaMonkey, Portable Edition - Using the Internet has become a necessity for a majority of people, including those who do not use a PC regularly. To browse web, stream video or download online content, people often resort to using various third party apps. For example, using ...

Serif CraftArtist 2 Professional - There are plenty of image editing tools available for Windows users but the number of scrapbooking apps is not much. However, with Serif CraftArtist Professional you can create sleek looking greeting card, digital albums and scrapbooks without ...

Adobe SpeedGrade - Adobe has been a long time player in video editing and post production sector, with apps like Premier Pro and AfterEffects winning accolades and keeping customers hooked for several years. To cater to a niche section of the target users, it has ...

Norman Antivirus - There is hardly any computer user who does not require protection from various types of malware and internet based threats these days. Instances of malware creators and hackers breaking into top corporate firms and celebrity websites can send a ...

Freemake Video Converter - Video conversion can become a necessity for average PC users who find it increasingly hard to manage an ever growing collection of media and video files. The DVDs, videos obtained from web and clips shot with mobile devices keep growing. Over ...

TrustPort Tools - Nowadays, PC users need to deal with several types of third party apps to ensure security and privacy of data. From encrypting files to getting rid of sensitive data, the needs can be numerous. There are many such tools that can be used in this ...

Screenpresso Pro - Capturing screenshots and webcam streams can become a necessity at times for PC users. There was a time most users resorted to Windows bundled print screen utility but now there are so many choices to pick from. If you want a feature rich and ...

Simpo PDF Creator Pro - Millions of PC users resort to using PDF format for exchanging and sharing documents for a number of needs. PDF is cross platform compatible, print friendly and can contain various objects like text, image and fields. While a majority of people ...

SyncMate - Just like windows users, Macintosh users also need to sync their data with myriads of other devices and other Macs. It is possible to use Apple’s much touted iCloud to sync a Mac with other iOS based devices but that may not fit ...

New Downloads

BarCodeWiz Barcode ActiveX

Create single barcodes, pages
of labels, or mail merge
documents in Microsoft Word.
Convert cells to barcodes or
full ...

Contact Form Generator

Contact Form Generator is an
easy-to-use PHP script for
creating contact and email
forms. The contact form script
allows ...


Website visitors can send and
receive files with your
Hosted~FTP~ account


Reads a trace from Tektronics
370 Curve Traqcer

Cropping an Image with
resizable and draggable

Crops the Image from a
resizable & draggable


This plugin gives you an easy
way to use the Visualize
jQuery plugin into WordPress

SVN Profiling

Read data from files tagged
with SVN
keywords [svn_profile,svn_str
] =
ords,strs) This ...

Search Lucene API Node

Search Lucene API Node Filter
is an add on module to Search
Lucene API.

a 3d quasi fuchsian map

a 3d quasi fuchsian map using
3 generators

Gaussian Filter,
Determination of integer

Within a sigma range separable
filters with integer
parameters are sought

Evaporator and Gradient

This package includes a
Simulink model of the
evaportaor described by Newell
and Lee (1989) together with a
gradient ...


PHPMQ is an Open Source
serverless messaging toolkit
for PHP, giving the PHP
developer ability to perform
JMS operations ...