Re: Piecewise functions
- To: mathgroup at smc.vnet.net
- Subject: [mg8927] Re: [mg8876] Piecewise functions
- From: David Withoff <withoff>
- Date: Sat, 4 Oct 1997 22:08:05 -0400
- Sender: owner-wri-mathgroup at wolfram.com
> Hi ! > > I would like to know how to represent piecewise linear functions in > Mathematica. I tried searching on-line help but could not find any info > regarding this. > > Thanks for your help > > Venkat The answer to this question will depend on what you want to use the piecewise linear functions for. You can construct a piecewise linear function using Interpolation[data, InterpolationOrder -> 1], or you could use something like Which[x<0, 0, 0<=x<=1, x, x>1, 1], or you could use some other approach. The best way will depend on what you plan to do with the result. Dave Withoff Wolfram Research