MathGroup Archive 2001

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

Search the Archive

Re: UnitStep[] Problem.

"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.