Re: display of function
- To: mathgroup at smc.vnet.net
- Subject: [mg58522] Re: display of function
- From: Peter Pein <petsie at dordos.net>
- Date: Tue, 5 Jul 2005 06:34:14 -0400 (EDT)
- References: <dad7oo$t91$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Bosch, Darrell schrieb: > Dear Math Group: > > The first equation below shows a function for u(y) which is > the sum of the products of pi times yi. In the following steps, I > assign values of p and y. How can I get Mathematica to display the > numerical value of u for the given p and y values? When I insert the > u[y] command, I just get a repeat of the equation I have entered. > Thanks for your suggestions. This group is a great help. Darrell > > > > u[y_] := Sum[Subscript[p, i]*Subscript[y, i], > > {i, 1, n}] > > > > p = {.3,.4,.3} > > > > y={10000, 20000, 30000} > > Hi, just guessing: * you want Part[], not Subscript * you mean Length[p] (or Length[y]), not n * you expect the dot-product {.3,.4,.3).{10000, 20000, 30000} Am I right? -- Peter Pein Berlin http://people.freenet.de/Peter_Berlin/