Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #15742 > unrolled thread

Re: Mystifying Scoping of Piecewise Variable?

Started byTomas Garza <tgarza10@msn.com>
First post2011-02-03 10:27 +0000
Last post2011-02-03 10:27 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: Mystifying Scoping of Piecewise Variable? Tomas Garza <tgarza10@msn.com> - 2011-02-03 10:27 +0000

#15742 — Re: Mystifying Scoping of Piecewise Variable?

FromTomas Garza <tgarza10@msn.com>
Date2011-02-03 10:27 +0000
SubjectRe: Mystifying Scoping of Piecewise Variable?
Message-ID<iidvu9$bh7$1@smc.vnet.net>
Shouldn't the argument of myFunc in the definition be x_?
-Tomas

> Date: Wed, 2 Feb 2011 06:08:08 -0500
> From: frankeye@cox.net
> Subject:  Mystifying Scoping of Piecewise Variable?
> To: mathgroup@smc.vnet.net
>
> Perhaps I'm tired, but this is weird:
>
> Clear[myFunc]
>
> myFunc[y_] = Piecewise[{{x^2, x < 0}, {x, x >= 0}}]
>    (Same behavior below for either Set(=) or SetDelayed(:=) )
>
> Plot[myFunc[y], {y, -10, 10}]
>   (returns empty plot)
>
> Plot[myFunc[x], {x, -10, 10}]
>   (returns "expected" piecewise function plot)
>
> What is the scoping of the Piecewise variable, in this case "x"? 
>
> How can one write a Module that creates and returns a Piecewise function? The scope of its argument is unclear to me.
>
> Thanks

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web