Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2003
*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 2003

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

Search the Archive

RE: How to convert string to variable name

  • To: mathgroup at smc.vnet.net
  • Subject: [mg39833] RE: [mg39795] How to convert string to variable name
  • From: "David Park" <djmp at earthlink.net>
  • Date: Sat, 8 Mar 2003 02:49:50 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Bob,

Use the Symbol statement. Symbol["w"] gives the symbol w.

Symbol["w"]
% // Head
w
Symbol

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/ 



From: Bob Harris [mailto:NspamITmeLION at MINDnotSPRING.COM]
To: mathgroup at smc.vnet.net

Howdy,

I'm trying to write a loop that assigns functions to a series of variables
which I'd like to name z, y, x, w, ... and so on.  The functions are matrix
operator of a group, which I would use like this, for example:

    state // w // z // w // w

Clearly I can generate the strings "z", "y", "x", "w" ... in my loop.  But
for a given string, how can I assign to the variable whose name is defined
by that string?

-- 
-- Bob Harris =======================================================+
| If stupidity got us into this mess, how come it can't get us out   |
| of it?                                                             |
+====================================================================+





  • Prev by Date: EPS margin problem
  • Next by Date: Re: How to convert string to variable name
  • Previous by thread: Re: How to convert string to variable name
  • Next by thread: Re: How to convert string to variable name