Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

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/


  • Prev by Date: Re: a question about the UnitStep function
  • Next by Date: Re: Re: how to find n in expression x^n using a pattern?
  • Previous by thread: Re: Re: Can't assign value to symbols
  • Next by thread: Re: Re: Re: Can't assign value to symbols