MathGroup Archive 2013

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

Search the Archive

Re: what is wrong with this code?


Am 02.04.2013 09:24, schrieb dougwangsaif at gmail.com:
> f[x_] := If[EvenQ[IntegerPart[x]], 0.4, 0.8];
> Plot[f[x], {x, 1, 101}]
>
nothing wrong

and this is correct too:

f[x_] := If[EvenQ[IntegerPart[x]], 0.4, 0.8];
Plot[f[x], {x, 1, 101}, PlotPoints -> 103]

Peter




  • Prev by Date: Re: what is wrong with this code?
  • Next by Date: Re: Packages with data sets
  • Previous by thread: Re: what is wrong with this code?
  • Next by thread: Re: IntegerPart