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: Animate Command and Vector Reference
Replies: 1   Last Post: Jul 3, 2013 6:05 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
Bob Hanlon

Posts: 906
Registered: 10/29/11
Re: Animate Command and Vector Reference
Posted: Jul 3, 2013 6:05 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

This is a scoping issue. The a used in the Animate iterator is local to the

sub = {{a, 1}, {a^2, 1}};

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

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.