MathGroup Archive 2005

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

Search the Archive

Re: lists of variables

  • To: mathgroup at smc.vnet.net
  • Subject: [mg58199] Re: [mg58156] lists of variables
  • From: Pratik Desai <pdesai1 at umbc.edu>
  • Date: Wed, 22 Jun 2005 01:55:41 -0400 (EDT)
  • References: <200506200921.FAA26334@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Heath Gerhardt wrote:

>I need to make lists of variables, for example
>
>{t1,t2,t3}
>
>but have not been able to figure out how to make Mathematica do this. 
>Tried using
>
>Array[t,3]
>
>which gives
>
>{t[1],t[2],t[3]}
>
>but then I don't know how to set the t[i]'s in expressions similar to
>
>F[t[1]_,t[2]_,t[3]_]:=Cos[t[1]+t[2]-t[3]]
>
>thanks in advance
>Heath
>
>  
>
Here is a somewhat different approach using Subscript
t = Table[Subscript[s, j], {j, 1, 3, 1}] // Total
Cos[t]
 >>\!\(Cos[s\_1 + s\_2 + s\_3]\)
You can even assing values
Subscript[s,1]=30
Subscript[s,2]=0
Subscript[s,3]=90
Best regards,
Pratik

-- 
Pratik Desai
Graduate Student
UMBC
Department of Mechanical Engineering
Phone: 410 455 8134



  • Prev by Date: Re: Problems with my first package: Statistics`Common`RegressionCommon`BestFitParameters instead of BestFitParameters
  • Next by Date: Updates to visualization site
  • Previous by thread: lists of variables
  • Next by thread: Re: Re: Problems with my