MathGroup Archive 2002

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

Search the Archive

Re: Nonatomic expression ? in Append command


Hi,


you can only append a *element* to a list. Since you Clear[omegaAList]
it has no value you need:

Clear[et1, omegaAlist]

omegaAlist = {};

For[r = 0, r <= 1, r++ , et1 = 3.444 + r*0.001; 
  omegaAlist = Append[omegaAlist, N[et1]];
  ]
omegaAlist = Delete[omegaAlist, 1];

Avoid explicit loops with For[] and Append[]/AppendTo[]

Regards
  Jens



Takayuki MAKINO wrote:
> 
> bonjour
> 
> I am very happy to meet you all. My name is Takayuki. It is my great
> pleasure to know the existense of such beautiful community. I would like
> to perform the loop calculation by writing the following code in
> Mathematica. Then, the result of calculation should be stored in some
> lists, assuming the name of list is "omegaAlist". If one performs that
> code, the error message will be output. The contents of which is the
> following:
> 
> (1)「Append::"normal": "Nonatomic expression expected at position 1
> in Append[omegaAlist, 0.007]."」
> 
> (2)「$RecursionLimit::"reclim": "Recursion depth of \!\(256
> \) exceeded."」
> 
> I do not know how to work around this problem. Please help me to
> eliminate this obstacle, if there are experts who are familiar with
> these kinds of things.!!!
> 
> ------------------------------------------------
> 
> Clear[et1,omegaAlist]
> For[r =0, r <= 1, r++
> 
> et1 = 3.444 + r*0.001
> 
> omegaAlist = Append[omegaAlist, N[et1]];
> ]
> omegaAlist = Delete[omegaAlist, 1];


  • Prev by Date: Partitions
  • Next by Date: Re: Nonatomic expression ? in Append command
  • Previous by thread: Re: Nonatomic expression ? in Append command
  • Next by thread: Re: Nonatomic expression ? in Append command