Re: Error message need explaination in english
- To: mathgroup at smc.vnet.net
- Subject: [mg78657] Re: [mg78631] Error message need explaination in english
- From: DrMajorBob <drmajorbob at bigfoot.com>
- Date: Fri, 6 Jul 2007 03:25:51 -0400 (EDT)
- References: <27555612.1183630922905.JavaMail.root@m35>
- Reply-to: drmajorbob at bigfoot.com
You passed metareplace a constant, and metareplace tried to change it. This avoids passing metaraplace's argument "by value": Q = Range[10]; size[group_] = Length[group]; SetAttributes[metareplace, HoldFirst] metareplace[ group_] := (group[[Random[Integer, {1, size[group]}]]] = hubl[metacommunity]); metareplace[Q] Q hubl[metacommunity] {hubl[metacommunity], 2, 3, 4, 5, 6, 7, 8, 9, 10} Bobby On Thu, 05 Jul 2007 04:51:50 -0500, JGBoone at gmail.com <JGBoone at gmail.com> wrote: > So i put in these commands > > Q=Range[10]; > size[group_]=Length[group]; > metareplace[group_] := (group[[Random[Integer, {1, size[group]}]]] == > hubl[metacommunity]); > (*takes random element of community size and replaces it with random > element of metacommunity by way of the function hubl[group_]*) > metareplace[Q] > > > and get this error message > > Set::setps: {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} in assignment of part is > not a symbol > > looking at the help menu only confuses me further. can anyone tell me > in layman's terms what the messages means? > thanks > > > -- DrMajorBob at bigfoot.com