Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #14035 > unrolled thread
| Started by | James Stein <mathgroup@stein.org> |
|---|---|
| First post | 2013-04-03 08:07 +0000 |
| Last post | 2013-04-03 08:07 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: what is wrong with this code? James Stein <mathgroup@stein.org> - 2013-04-03 08:07 +0000
| From | James Stein <mathgroup@stein.org> |
|---|---|
| Date | 2013-04-03 08:07 +0000 |
| Subject | Re: what is wrong with this code? |
| Message-ID | <kjgnvr$pst$1@smc.vnet.net> |
An interesting plot! It appears that Mathematica does not evaluate 'f' at a
sufficient number of points. In the documentation, i could not find a way
to control that; perhaps others will. This code shows the problem:
Clear[f, g, z];
z = {};
f[x_] := If[EvenQ[IntegerPart[x]], 0.4, 0.8];
g[x_] := (z = {z, x}; f[x]);
Plot[g[x], {x, 1, 101}]
z // Flatten // IntegerPart // DeleteDuplicates // Sort
On Tue, Apr 2, 2013 at 12:24 AM, <dougwangsaif@gmail.com> wrote:
> f[x_] := If[EvenQ[IntegerPart[x]], 0.4, 0.8];
> Plot[f[x], {x, 1, 101}]
>
>
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web