Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #15133
| From | Alexei Boulbitch <Alexei.Boulbitch@iee.lu> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Re: Animate Command and Vector Reference |
| Date | 2013-07-06 08:59 +0000 |
| Message-ID | <kr8ma6$e2$1@smc.vnet.net> (permalink) |
| Organization | Time-Warner Telecom |
This is a scoping issue. The a used in the Animate iterator is local to the
Animate.
sub = {{a, 1}, {a^2, 1}};
OK, Bob, and why this
sub[a_]:={{a,1},{a^2,1}};
Animate[Graphics[{Line[{{0,0},sub[a][[1]]/.a->aa}]}],{{aa,-1,"a"},-1,1}]
In version 6 this worked perfectly. What happened since?
Best regards, Alexei
This is a scoping issue. The a used in the Animate iterator is local to the
Animate.
sub = {{a, 1}, {a^2, 1}};
Animate[
Graphics[{
Line[{{0, 0}, sub[[1]] /. a -> aa}]
}],
{{aa, -1, "a"}, -1, 1}]
Bob Hanlon
On Wed, Jul 3, 2013 at 4:59 AM, William Dickinson <
william.dickinson.0718 at gmail.com> wrote:
> I'm new to Mathematica and I want to create some animations. I tried
> something like this:
>
> sub = {{a, 1}, {a^2, 1}}
> Animate[Graphics[{Line[{{0, 0}, sub[[1]]}]}], {a, -1, 1}]
>
> and Mathematica give me an error. This error ( Coordinate {a, 1} should be
> a pair of numbers, or a Scaled or Offset form.) is not helpful.
>
> I know that I can fix this by changing sub[[1]] to {a,1}, but this is not
> a great solution. I have several places in the actual Animate command that
> use sub[[1]] (some in conjunction with a Table command) and it would be
> painful to do all of the replacing and rewriting. How can I make something
> like this work?
>
> I suspect that I'm missing something simple....
>
>
> Thanks in advance!
>
> Will
>
>
>
Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG
Office phone : +352-2454-2566
Office fax: +352-2454-3566
mobile phone: +49 151 52 40 66 44
e-mail: alexei.boulbitch@iee.lu
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: Re: Animate Command and Vector Reference Alexei Boulbitch <Alexei.Boulbitch@iee.lu> - 2013-07-06 08:59 +0000
csiph-web