Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Vector Piecewise in 5.1

  • To: mathgroup at smc.vnet.net
  • Subject: [mg52996] Vector Piecewise in 5.1
  • From: "Mark Fisher" <mark at markfisher.net>
  • Date: Sun, 19 Dec 2004 06:14:40 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

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?

--Mark


  • 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