Code covered by the BSD License
by Andrew Davis
26 Jan 2012
Return positive and negative areas, assuming a piecewise linear function
| Watch this File
PWLINT.m Calculate the positive and negative area under a curve using trapezoids, assuming a piecewise linear function
Requires insertrows: http://www.mathworks.com/matlabcentral/fileexchange/9984
Inspired by this thread: http://www.mathworks.com/matlabcentral/newsreader/view_thread/252131
Usage: [Apos, Aneg, Anet] = pwlint(x,y) x: vector of independent variable y: vector of dependent variable Apos: area between y=0 and positive y values Aneg: area between y=0 and negative y values Anet: Apos+Aneg; equal to trapz(x,y)
See also TRAPZ, SUM
Insertrows (V2.0, May 2008) inspired this file.
Contact us