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 ]
Bob Hanlon

Posts: 895
Registered: 10/29/11
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

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

rr

Or

rr = Table[a^b, {a, 2, 5},
{b, 2, 5}]//Flatten

Or

rr = Table[a^Range[2, 5],
{a, 2, 5}]//Flatten


Bob Hanlon


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

> hello i am new to mathmatica.i have the following problem if anyone could help.
>
> For[a = 2, a < 6, a++,
> For[b = 2, b < 6, b++,
> Appendto[rr = {}, a^b]]]
> rr
>
> but rr remains empty. how can i solve this
> thank you
>





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.