Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


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

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}]

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}]






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

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.