Be the first to rate this file! 4 Downloads (last 30 days) File Size: 1.73 KB File ID: #34787
image thumbnail

PWLINT: Piecewise Linear Integration

by Andrew Davis

 

26 Jan 2012

Return positive and negative areas, assuming a piecewise linear function

| Watch this File

File Information
Description

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

Acknowledgements

Insertrows (V2.0, May 2008) inspired this file.

Required Products MATLAB
MATLAB release MATLAB 7.12 (R2011a)
Tags for This File  
Everyone's Tags
integration, mathematics, numerical, signal processing, trapezoid
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.

Contact us