MathGroup Archive 1997

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Piecewise functions


> 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


  • Prev by Date: Re: FindRoot
  • Next by Date: Deleting Graphics Elements
  • Previous by thread: Re: Piecewise functions
  • Next by thread: Re: Piecewise functions