Re: Nonatomic expression ? in Append command
- To: mathgroup at smc.vnet.net
- Subject: [mg32844] Re: Nonatomic expression ? in Append command
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Fri, 15 Feb 2002 02:49:43 -0500 (EST)
- Organization: Universitaet Leipzig
- References: <a4fo5k$j55$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
- Sender: owner-wri-mathgroup at wolfram.com
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];