Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #4128 > unrolled thread
| Started by | "DaleJenk" <dale.jenkins8@deletegooglemail.com> |
|---|---|
| First post | 2011-08-02 11:12 +0000 |
| Last post | 2011-08-03 11:16 +0000 |
| Articles | 5 — 5 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
Do command "DaleJenk" <dale.jenkins8@deletegooglemail.com> - 2011-08-02 11:12 +0000
Re: Do command Peter Breitfeld <phbrf@t-online.de> - 2011-08-03 11:05 +0000
Re: Do command "andre.robin3" <andre.robin3@wanadoo.fr> - 2011-08-03 11:06 +0000
Re: Do command "Dr. Wolfgang Hintze" <weh@snafu.de> - 2011-08-03 11:10 +0000
Re: Do command "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com> - 2011-08-03 11:16 +0000
| From | "DaleJenk" <dale.jenkins8@deletegooglemail.com> |
|---|---|
| Date | 2011-08-02 11:12 +0000 |
| Subject | Do command |
| Message-ID | <j18m27$slc$1@smc.vnet.net> |
I'm working my way through the 1999 edition of Mathematica Navigator and
using Mathematica 7 Home Edition. The following command is supposed to bring
up a plot but for some reason it doesn't.
Do[Plot[Sin[x - c], {x, 0, 4 Pi, Pi/10}, Ticks -> None], {c, 0,
2 Pi - Pi/10, Pi/10}]
Thanks for any help.
[toc] | [next] | [standalone]
| From | Peter Breitfeld <phbrf@t-online.de> |
|---|---|
| Date | 2011-08-03 11:05 +0000 |
| Message-ID | <j1ba2m$ahr$1@smc.vnet.net> |
| In reply to | #4128 |
"DaleJenk" wrote:
> I'm working my way through the 1999 edition of Mathematica Navigator and
> using Mathematica 7 Home Edition. The following command is supposed to bring
> up a plot but for some reason it doesn't.
>
> Do[Plot[Sin[x - c], {x, 0, 4 Pi, Pi/10}, Ticks -> None], {c, 0,
> 2 Pi - Pi/10, Pi/10}]
>
> Thanks for any help.
First, the range specification for Plot is wrong. Plot expects three
Elements, not four. So it should be
Do[Plot[Sin[x - c], {x, 0, 4 Pi}, Ticks -> None],
{c, 0, 2 Pi - Pi/10, Pi/10}]
But this will give you no output too, because Do returns Null (nothing).
You can do the following:
Do[Print@Plot[Sin[x - c], {x, 0, 4 Pi}, Ticks -> None],
{c, 0, 2 Pi - Pi/10, Pi/10}]
or
Table[Plot[Sin[x - c], {x, 0, 4 Pi}, Ticks -> None],
{c, 0, 2 Pi - Pi/10, Pi/10}]
--
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de
[toc] | [prev] | [next] | [standalone]
| From | "andre.robin3" <andre.robin3@wanadoo.fr> |
|---|---|
| Date | 2011-08-03 11:06 +0000 |
| Message-ID | <j1ba3k$ai9$1@smc.vnet.net> |
| In reply to | #4128 |
The reason is that since version 6 of mathematica, the output
of Plot is no more a side effect.
The solution :
Do[ Print [ Plot[Sin[x - c], {x, 0, 4 Pi, Pi/10}, Ticks -> None] ]
, {c, 0,
2 Pi - Pi/10, Pi/10}]
"DaleJenk" <dale.jenkins8@deletegooglemail.com> a écrit dans le message de
news: j18m27$slc$1@smc.vnet.net...
> I'm working my way through the 1999 edition of Mathematica Navigator and
> using Mathematica 7 Home Edition. The following command is supposed to
> bring
> up a plot but for some reason it doesn't.
>
> Do[Plot[Sin[x - c], {x, 0, 4 Pi, Pi/10}, Ticks -> None], {c, 0,
> 2 Pi - Pi/10, Pi/10}]
>
> Thanks for any help.
>
>
>
[toc] | [prev] | [next] | [standalone]
| From | "Dr. Wolfgang Hintze" <weh@snafu.de> |
|---|---|
| Date | 2011-08-03 11:10 +0000 |
| Message-ID | <j1baac$alh$1@smc.vnet.net> |
| In reply to | #4128 |
"DaleJenk" <dale.jenkins8@deletegooglemail.com> schrieb im Newsbeitrag
news:j18m27$slc$1@smc.vnet.net...
> I'm working my way through the 1999 edition of Mathematica Navigator
> and
> using Mathematica 7 Home Edition. The following command is supposed
> to bring
> up a plot but for some reason it doesn't.
>
> Do[Plot[Sin[x - c], {x, 0, 4 Pi, Pi/10}, Ticks -> None], {c, 0,
> 2 Pi - Pi/10, Pi/10}]
>
> Thanks for any help.
>
>
>
Executing your command gives the error message
Plot::"pllim" :"Range specification x, 0, 2 Pi, Pi/10} is not of
the form {x, xmin, xmax}."
and it tells you what is wrong.
Correcting the error:
Do[Plot[Sin[x - c], {x, 0, 4 Pi}, Ticks -> None], {c, 0, 2 Pi -
Pi/10, Pi/10}]
you'll get what you want.
Regards,
Wolfgang
[toc] | [prev] | [next] | [standalone]
| From | "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com> |
|---|---|
| Date | 2011-08-03 11:16 +0000 |
| Message-ID | <j1bamq$aoh$1@smc.vnet.net> |
| In reply to | #4128 |
On Tue, 02 Aug 2011 12:12:07 +0100, DaleJenk
<dale.jenkins8@deletegooglemail.com> wrote:
> I'm working my way through the 1999 edition of Mathematica Navigator and
> using Mathematica 7 Home Edition. The following command is supposed to
> bring
> up a plot but for some reason it doesn't.
>
> Do[Plot[Sin[x - c], {x, 0, 4 Pi, Pi/10}, Ticks -> None], {c, 0,
> 2 Pi - Pi/10, Pi/10}]
>
> Thanks for any help.
>
Do[
Print@Plot[Sin[x - c], {x, 0, 4 Pi}, Ticks -> None],
{c, 0, 2 Pi - Pi/10, Pi/10}
]
But this is probably more like what was intended:
Reap@Do[
Sow@Plot[Sin[x - c], {x, 0, 4 Pi}, Ticks -> None],
{c, 0, 2 Pi - Pi/10, Pi/10}
] // Flatten // ListAnimate
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web