Re: returning a variable's name, rather than the variable's contents
- To: mathgroup at smc.vnet.net
- Subject: [mg68429] Re: [mg68422] returning a variable's name, rather than the variable's contents
- From: Takashi YOSHINO <tyoshino at toyonet.toyo.ac.jp>
- Date: Sat, 5 Aug 2006 03:46:07 -0400 (EDT)
- References: <200608040759.DAA01103@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
variables = {a, b, c, d, e};
values = {1, 2, 3, 4, 5};
Max[values] /. Thread[values -> variables]
Michael Stern wrote:
> There must be a simple way to do this but it eludes me. Take for example the
> following:
>
>
>
> In[2]:= a=1;b=2;c=3;
>
>
>
> In[3]:= Max[a,b,c]
>
>
>
> Out[3]= 3
>
>
>
> What would I do if I wanted Out[3] to equal "c" ?
>
>
>
> Thanks in advance,
>
>
>
> Michael Stern
>
>
>
--
Takashi Yoshino
- References:
- returning a variable's name, rather than the variable's contents
- From: "Michael Stern" <stern@merrinmanagement.com>
- returning a variable's name, rather than the variable's contents