Search All of the Math Forum:

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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

 Messages: [ Previous | Next ]
 Tomas Garza Hernandez Posts: 264 Registered: 4/15/05
Re: problem with append
Posted: Jan 21, 2013 12:07 AM

The correct name is AppendTo, not Appendto. You should start by defining the empty list rr, and then AppendTo rr consecutively, i.e..
In[4]:= rr={}; For[a=2,a<6,a++,For[b=2,b<6,b++,AppendTo[rr,a^b]]]In[5]:= rrOut[5]= {4,8,16,32,9,27,81,243,16,64,256,1024,25,125,625,3125}
-TG

> From: paolocach@gmail.com
> Subject: problem with append
> To: mathgroup@smc.vnet.net
> Date: Sun, 20 Jan 2013 01:21:48 -0500
>
> 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
>

Date Subject Author
1/21/13 Chris Arthur
1/21/13 Bob Hanlon
1/22/13 David Bailey
1/21/13 Murray Eisenberg
1/21/13 KING NIGEL-NKI001
1/21/13 yehuda ben-shimol
1/21/13 Tomas Garza Hernandez