MathGroup Archive 2004

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

Search the Archive

Vector Piecewise in 5.1

To my surprise (and delight) it turns out that Piecewise in 5.1 can
handle vectors (to some extent):

pw1 = Piecewise[{{x, x > 0}}]
pw2 = Piecewise[{{x2, x > 0}}]

pw = PiecewiseExpand[{pw1, pw2}]

This can even be compiled successfully:

cf = Compile[{x}, Evaluate[pw]]

And differentiated:

D[pw, x]

But not, however, integrated:

Integrate[pw, x]

(Worse, Integrate[pw, {x, 0, 3}] returns a scalar.)
Is this a bug or just the absence of an undocumented feature?


  • Prev by Date: Re: How make a package
  • Next by Date: Re: infinite sum problem
  • Previous by thread: Re: Value of Zeta[3]
  • Next by thread: Re: Vector Piecewise in 5.1