The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: IntegerPart
Replies: 3   Last Post: Apr 2, 2013 3:26 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Dave Snead

Posts: 52
Registered: 12/13/04
Re: IntegerPart
Posted: Apr 2, 2013 3:25 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

There's nothing wrong with the IntegerPart function.
Use ListLinePlot instead of Plot:

ListLinePlot[prefstate, AxesOrigin -> {0, 0},
TicksStyle -> Directive[18], PlotStyle -> {Black}]

Dave Snead

-----Original Message-----
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!

nSize = 100;

prefstate = Table[0, {i, 1, nSize}];
{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}]

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.