Re: best solution?
- To: mathgroup at smc.vnet.net
- Subject: [mg22946] Re: [mg22899] best solution?
- From: "Tomas Garza" <tgarza at mail.internet.com.mx>
- Date: Fri, 7 Apr 2000 02:54:29 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Peter Weijnitz [peter.weijnitz at perimed.se] wrote:
> I have a function e.g F[a,b,c,x] =a Sin[b x +c] and a number of parameter
> triplets
> k={{a1,b1,c1},{a2,b2,c2},{a3,b3,c3},....}.
> I would like to feed my function the parameter values in an good
> and simple
> way, how?
>
> (Picking out the elements like k[[3,2]]=b3 e.t.c is not what I want.)
> /Peter
Of course, it all depends how you want to use your setup, but would
something like this work for you?
In[1]:=
k = {{a1, b1, c1}, {a2, b2, c2}, {a3, b3, c3}};
In[2]:=
g[w_, x_] := w[[1]]*Sin[w[[2]]*x + w[[3]]]
In[3]:=
g[k, x]
Out[3]=
{a1 Sin[a3 + a2 x], b1 Sin[b3 + b2 x], c1 Sin[c3 + c2 x]}
Tomas Garza
Mexico City