Re: Can't assign value to symbols
- To: mathgroup at smc.vnet.net
- Subject: [mg58503] Re: Can't assign value to symbols
- From: Peter Pein <petsie at dordos.net>
- Date: Tue, 5 Jul 2005 01:57:43 -0400 (EDT)
- References: <da5jcd$243$1@smc.vnet.net> <200507030757.DAA18271@smc.vnet.net> <daalgc$5u5$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
stephen layland schrieb: > and thus spake Peter Pein [2005.07.03 @ 04:08]: > >>Lee Newman schrieb: >> >>>Thanks for the solutions. I'm running with David Park's solution, but >>>now realize there is one additional problem. Once I've executed the >>>statement MapThread[(#1 = #2) & , {parameters[[1]], parameters[[3]]}] , >>>because I've specified the first row of "parameters" as symbols, this >>>row now loses the symbol names and takes on the assigned values, such >>>that my attempt to execute the MapThread Statement again for a different >>>set of values, e.g. parameters[[2]], fails. > > [ ... ] > >>use Clear to clear the assigned values: > > > As others have already suggested, this is a situation where > Mathematica's *Rule Replacements* shine. Instead of setting and > clearing variables, it would be more efficient to apply diffierent > rules. ... > There are at least Aleph0 different ways to do things, but functional > and rule based approaches will almost always be the most efficient > in Mathematica. > > Happy hacking. > -- > /*------------------------------*\ > | stephen layland | > | Documentation Programmer | > | http://members.wri.com/layland | > \*------------------------------*/ > Thanks Stephen, you might have noticed my first posting in this thread (Message-Id: <da5i8s$1q3$1 at smc.vnet.net>). Generally I prefer functionally/rule-based style. _Lee_ has chosen David's approach ( MapThread[(#1 = #2) & , {parameters[[1]], parameters[[3]]}] ). I just answered his question regarding assignments to the variables. Sincerly, Peter -- Peter Pein Berlin http://people.freenet.de/Peter_Berlin/
- References:
- Re: Can't assign value to symbols
- From: Peter Pein <petsie@dordos.net>
- Re: Can't assign value to symbols