quadsr

Trapezoidal rule quadrature (numerical integration) with sub-range specification

Syntax

   [q,xrsupp] = quadsr(x,y,xrange)

Arguments

input

   x          vector of evaluation points
   y          vector of values corresponding to x
   xrange     x sub-range(s) specification vector

output

   q          quadrature of y over specified sub-range(s) of x values
   xrsupp     the "support" (total length) of the  x sub-range(s)

Description

A trapezoidal rule quadrature routine (cf. trapz) where a series of sub-ranges of integration may be specified in xrange. xrange must be an ascending vector of even length, specifying start and end values of a series of sub-ranges. A NaN at the beginning (resp. end) of xrange specifies the beginning (resp. end) of the range of x. The integral (quadrature) of y over the sub-range(s) is returned in q. The "support" - i.e. total length of sub-range(s) - is returned in xrsupp.

See also

trapz | quads | smvgc_to_mvgc