Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Animate Command and Vector Reference

  • To: mathgroup at smc.vnet.net
  • Subject: [mg131426] Re: Animate Command and Vector Reference
  • From: Bob Hanlon <hanlonr357 at gmail.com>
  • Date: Wed, 3 Jul 2013 22:04:22 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-outx@smc.vnet.net
  • Delivered-to: mathgroup-newsendx@smc.vnet.net
  • References: <20130703085946.6C4086A98@smc.vnet.net>

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




  • Prev by Date: Re: Changing a list with the information of other
  • Next by Date: Re: Define function using lists or tables
  • Previous by thread: Animate Command and Vector Reference
  • Next by thread: Re: Re: Animate Command and Vector Reference