MathGroup Archive 2013

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

Search the Archive

Re: what is wrong with this code?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg130336] Re: what is wrong with this code?
  • From: Peter Pein <petsie at dordos.net>
  • Date: Wed, 3 Apr 2013 04:12:03 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net
  • References: <kje13u$grc$1@smc.vnet.net>

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