|
Re: IntegerPart
Posted:
Apr 2, 2013 3:25 AM
|
|
There's nothing wrong with the IntegerPart function. Use ListLinePlot instead of Plot:
ListLinePlot[prefstate, AxesOrigin -> {0, 0}, TicksStyle -> Directive[18], PlotStyle -> {Black}]
Cheers, Dave Snead
-----Original Message----- From: dougwangsaif@gmail.com Sent: Sunday, March 31, 2013 9:58 PM Subject: IntegerPart
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}]
|
|