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

MathGroup Archive 2013

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

Search the Archive

Re: problem with append

  • To: mathgroup at smc.vnet.net
  • Subject: [mg129530] Re: problem with append
  • From: Nigel King <nigel.king at cambiumnetworks.com>
  • Date: Mon, 21 Jan 2013 00:07:02 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net
  • References: <20130120062148.0CB436854@smc.vnet.net>

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 at gmail.com>
 wrote:

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





  • Prev by Date: Re: problem with append
  • Next by Date: Re: problem with append
  • Previous by thread: Re: problem with append
  • Next by thread: Re: problem with append