Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: problem with append
Replies: 9   Last Post: Jan 22, 2013 11:18 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
KING NIGEL-NKI001

Posts: 10
Registered: 3/21/12
Re: problem with append
Posted: Jan 21, 2013 12:07 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi Paolo,
I think that you have two errors.
The first is that AppendTo has a capital T
The second is that you need to initialise rr outside the loops. It seems that rr={} inside the AppendTo function is applying the initialisation after the Append

rr={};
For[a = 2, a < 6, a++,
For[b = 2, b < 6, b++,
AppendTo[rr, a^b]]]
rr

Nigel King

On 20 Jan 2013, at 06:21, Paolo cachecho <paolocach@gmail.com>
wrote:

For[a = 2, a < 6, a++,
For[b = 2, b < 6, b++,
Appendto[rr = {}, a^b]]]
rr






Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.