File Exchange

image thumbnail

simpsonQuadrature

version 1.2.0.0 (825 Bytes) by Matthew Kelly
Computes the integral of a function using Simpson quadrature

2 Downloads

Updated 13 Dec 2015

View License

% x = simpsonQuadrature(fun,tLow,tUpp,n)
%
% This function uses simpson quadrature over each of n uniform segments to
% approximate the integral of fun(t) on the interval tLow <= t <= tUpp
%
% INPUTS:
% fun = function handle
% f = fun(t)
% t = [1, nt] = time query points on [a,b]
% f = [nx, nt] = vector function at query points
% tLow = scalar lower bound on time
% tUpp = scalar upper bound on time
% n = number of segments to divide interval into
%
% OUTPUTS:
% x = [nx, 1] = integral along each dimension
%

Cite As

Matthew Kelly (2019). simpsonQuadrature (https://www.mathworks.com/matlabcentral/fileexchange/54457-simpsonquadrature), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (3)

pedro

Thanks for the heads-up. I've added that file (and one other) to my acknowledgements, since they were posted first.

Updates

1.2.0.0

added reference to existing simpson quadrature routine on file exchange.

1.1.0.0

added photo

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