Re: Nonatomic expression ? in Append command

*To*: mathgroup at smc.vnet.net*Subject*: [mg32837] Re: Nonatomic expression ? in Append command*From*: Erk Jensen <Erk.Jensen at cern.ch>*Date*: Fri, 15 Feb 2002 02:49:34 -0500 (EST)*References*: <a4fo5k$j55$1@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

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]; Salut, I find that your loop is a little weird, since r is increased by one, and your test is r<=1, but if I increase it a little bit to see it at work, I get a result that you might want, just by adding an initialization of omegaAlist: Clear[et1, omegaAlist] omegaAlist = {}; For[r = 0, r <= 10, r++, et1 = 3.444 + r 0.001; omegaAlist = Append[omegaAlist, N[et1]]; ] bonne journée -erk- -- Dr.-Ing. Erk JENSEN mailto:Erk.Jensen at cern.ch CERN PS/RF L19510 http://cern.ch/Erk.Jensen CH-1211 Geneva 23 Tel.: +41 22 76 74298 Switzerland Fax.: +41 22 76 78510