MathGroup Archive 2001

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

Search the Archive

Re: UnitStep[] Problem.

  • To: mathgroup at
  • Subject: [mg27338] Re: UnitStep[] Problem.
  • From: "Paul Lutus" <nospam at>
  • Date: Wed, 21 Feb 2001 03:17:18 -0500 (EST)
  • References: <96t8i6$>
  • Sender: owner-wri-mathgroup at

"Dustin Darcy" <ddarcy at> wrote in message
news:96t8i6$ppr at
> When I type in:
> Table[UnitStep[x], {x, -3, 3}]
> it should yield:
> {0,0,0,1,1,1,1}
> Instead, though, I get:
> {UnitStep[-3],UnitStep[-2],UnitStep[-1],UnitStep[0],UnitStep[1],UnitStep
> [2],UnitStep[3]}
> Is this due to not loading a certain package?

The result you expect is obtained on newer versions of Mathematica. Have you

MyStep[x_] := If[x >= 0,1,0]

Table[MyStep[x], {x, -3, 3}]


In this example, "MytStep[x]" is not exactly the same as Mathematica's own
"UnitStep[x]." But it may meet your requirements.

Also -- if you see a reference to "UnitStep[x]" in your version's help
screens, then you need to re-install Mathematica.

Paul Lutus

  • Prev by Date: Re: Hypocycloid Area
  • Next by Date: Re: simple Problem: D[ ]
  • Previous by thread: Re: UnitStep[] Problem.
  • Next by thread: Re: UnitStep[] Problem.