MathGroup Archive 2001

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

Search the Archive

Re: Preserve subscripts like integers using N


Guillerm,

You may want to do this

SetAttributes[Subscript, NHoldRest];

 N[Thread[Table[Subscript[x, i], {i, 1, 3}] ->
     {Pi, 2*Pi, 3*Pi}]]

and then clear

ClearAttributes[Subscript, NHoldRest];

Or you can set the attribute locally:

Block[{Subscript}, SetAttributes[Subscript, NHoldRest];
   N[Thread[Table[Subscript[x, i], {i, 1, 3}] ->
      {Pi, 2*Pi, 3*Pi}]]]


--
Allan

---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565


<guillerm at usal.es> wrote in message news:9vcck8$34n$1 at smc.vnet.net...
> I would like to preserve in the Outs the subscripts like integers using N
in
> expression like this. How can I do?
>
> In[1]:=Thread[Table[Subscript[x, i], {i, 1, 3}]->{Pi,2 Pi, 3 Pi}]//N
>
> Out[1]:={Subscript[x, 1.] -> 3.141592653589793, Subscript[x, 2.] ->
>    6.283185307179586, Subscript[x, 3.] ->
> 9.42477796076938}
>
> ---------------------------------------------
> This message was sent using Endymion MailMan.
> http://www.endymion.com/products/mailman/
>
>
>




  • Prev by Date: Re: Bump Function
  • Next by Date: Functions with Options
  • Previous by thread: Re: Preserve subscripts like integers using N
  • Next by thread: Re: Preserve subscripts like integers using N