MathGroup Archive 2006

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

Search the Archive

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


  • Prev by Date: Re: Something in the spirit of letrec
  • Next by Date: Re: returning a variable's name, rather than the variable's contents
  • Previous by thread: returning a variable's name, rather than the variable's contents
  • Next by thread: Re: returning a variable's name, rather than the variable's contents