MathGroup Archive 2001

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

Search the Archive

Re: UnitStep[] Problem.


"Dustin Darcy" <ddarcy at digipen.edu> wrote in message
news:96t8i6$ppr at smc.vnet.net...
> 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
tried:

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

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

{0,0,0,1,1,1,1}

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
www.arachnoid.com





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