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: what is wrong with this code?
Replies: 2   Last Post: Apr 3, 2013 4:08 AM

Advanced Search

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

Posts: 66
Registered: 4/28/07
Re: what is wrong with this code?
Posted: Apr 3, 2013 4:07 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

You're just seeing some artifacts. Increasing the plotpoints gives a better looking plot:

f[x_] := If[EvenQ[IntegerPart[x]], 0.4, 0.8];
Plot[f[x], {x, 1, 101}, PlotRange -> {0, 1}, PlotPoints -> 69]

BTW, next time try to be a bit more descriptive than just "what's wrong with this", OK?

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.