MathGroup Archive 2006

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

Search the Archive

Re: recursive blues :(


n00dle0 at yahoo.com wrote:
> Hi,
> 
> Why doesn't the following function represent a recurvive and periodic
> function?
> 
> \!\(\*
>   RowBox[{\(f[x_]\), " ", ":=", " ",
>     RowBox[{"\[Piecewise]", GridBox[{
>           {\(f[x + 2]\), \(x < \(-0.5\)\)},
>           {"2", \(\(-0.5\) = \ x = 0.5\)},
>           {"1", \(0.5 < x = 1.5\)},
>           {\(f[x - 2]\), \(x > 1.5\)}
>           }]}]}]\)
> 
> 
> What are all possible ways to represent periodic functions?
> 
> Thanks,
> Ash
> 
Typing syntacticly correct expressions should help:

f[x_] := Piecewise[{{f[x + 2], x < -0.5}, {2, -0.5 <= x <= 0.5}, {1, 
Inequality[0.5, Less, x, LessEqual, 1.5]}, {f[x - 2], x > 1.5}}]
Plot[f[x], {x, -2, 2}];

Regards,
Jean-Marc


  • Prev by Date: Re: Correlating binary variables
  • Next by Date: Re: LessSame
  • Previous by thread: recursive blues :(
  • Next by thread: Re: recursive blues :(