Re: Dimensions and Variables II
- To: mathgroup at smc.vnet.net
- Subject: [mg13736] Re: Dimensions and Variables II
- From: Tobias Oed <tobias at physics.odu.edu>
- Date: Wed, 19 Aug 1998 01:38:26 -0400
- Organization: Old Dominion University
- References: <6r1051$fib@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
naum at condor.physics.ucsb.edu wrote: > > I am starting to work on the variable problem. I am woried that I > wasn't clear enoughf in my news posting. Here is simple version of the > sort of thing that I am doing. > > f[x_]:=2x > g[y_]:=3y > h[z_]:=4z > > a[x_,y_,z_]:=f+g+h > b[x_,y_,z_]:=f*g*h > > L[x_,y_,z_]:=a+b > > Is there an easier way to do al this, like could I make V:={x,y,z} a > list and then just say L[V_]? does every leval need the explit > dependence declaration? I have tried alot of things and none of then > seem to work. > Thank You for any help you can give > -NAUM This may be a sollution (assuming you are interested in the dependency of your functions on the original variables x,y and z) f=2 x g=3 y h=4 z a= f + g + h b= f * g * h L=a+b If you want the value of L[x=3,y=9,z=-1] you can use: L /. {x->3,y->9,z->-1} Tobias