MathGroup Archive 1998

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

Search the Archive

Re: Rectangular function

  • To: mathgroup at
  • Subject: [mg14047] Re: [mg14036] Rectangular function
  • From: BobHanlon at
  • Date: Fri, 18 Sep 1998 03:50:30 -0400
  • Sender: owner-wri-mathgroup at

One approach:

rect[x_, intvl_:1] := Sum[(-1)^Floor[t/intvl] *
	UnitStep[t/intvl], {t, 0, x, intvl}]; Plot[rect[x], {x, 0, 6}];
Plot[{rect[x, Pi/2], Sin[x]}, {x, 0, 4Pi}]; Plot[rect[x, Pi/2] * Sin[x],
{x, 0, 4Pi}]; Plot[{2rect[x, Pi/2]-1, Sin[x]}, {x, 0, 4Pi}];
Plot[(2rect[x, Pi/2]-1) * Sin[x], {x, 0, 4Pi}]; Plot[{2rect[x, Pi]-1,
Sin[x]}, {x, 0, 4Pi}]; Plot[(2rect[x, Pi]-1) * Sin[x], {x, 0, 4Pi}];
Plot[{2rect[x, 2Pi]-1, Sin[x]}, {x, 0, 4Pi}]; Plot[(2rect[x, 2Pi]-1) *
Sin[x], {x, 0, 4Pi}];

Bob Hanlon

In a message dated 9/16/98 6:21:32 PM, A.Strobel at wrote:

>I'd like to simulate a rectangular voltage source. How can I define such
>a function in Mathematica?
>Example: It must be possible then to multiply a Sinus-function with the
>rectangular function.

  • Prev by Date: Re: Rectangular function
  • Next by Date: Re: EPS format problems
  • Previous by thread: Re: Rectangular function
  • Next by thread: MathLink & Visual Basic 4.0