MathGroup Archive 2013

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

Search the Archive

Re: IntegerPart


Am 01.04.2013 06:57, schrieb dougwangsaif at gmail.com:
> can anyone help with this. There seems to be something wrong with the IntegerPart function. Please help!
>
> Clear["Global`*"]
> nSize = 100;
>
> prefstate = Table[0, {i, 1, nSize}];
> Do[
>    {prefstate[[i]] = If[EvenQ[i], 0.8, 0.4]},
>    {i, 1, nSize}
>    ];
>
> Plot[{prefstate[[IntegerPart[x]]]}, {x, 1, nSize + 1},
>   AxesOrigin -> {0, 0}, TicksStyle -> Directive[18],
>   PlotStyle -> {Black}]
>

Hi,

  the Plot-algorithm simply selects too few supporting points. Adding 
the rule PlotPoints -> nSize + 3 to the call to Plot[] will show the 
complete graph.

Peter



  • Prev by Date: Re: Overdetermined NDSolve
  • Next by Date: Re: IntegerPart
  • Previous by thread: Re: IntegerPart
  • Next by thread: Re: IntegerPart