Re: best solution?

• To: mathgroup at smc.vnet.net
• Subject: [mg22920] Re: best solution?
• From: "Seth Chandler" <SChandler at uh.edu>
• Date: Thu, 6 Apr 2000 02:04:36 -0400 (EDT)
• Organization: University of Houston
• References: <8ce9t3\$14a@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Permits something like this would work.

First, I arbitrarily define your data.

triplets = Transpose[{Array[a, {6}], Array[b, {6}], Array[c, {6}]}];

Then, we write a function that does what you want and Map it onto the
triplets.

Block[{F},
F[{a_, b_, c_}] = a Sin[b x + c];
Map[F, triplets]]

We get what I think you want.

{a[1] Sin[x b[1] + c[1]], a[2] Sin[x b[2] + c[2]], a[3] Sin[x b[3] + c[3]],
a[4] Sin[x b[4] + c[4]], a[5] Sin[x b[5] + c[5]], a[6] Sin[x b[6] + c[6]]}

P.S. -- It is considered better Mathematica practice to you lower case for
the name of user-created functions.

Seth J. Chandler
Assoc. Prof. of Law
University of Houston Law Center

"Peter Weijnitz" <peter.weijnitz at perimed.se> wrote in message
news:8ce9t3\$14a at smc.vnet.net...
> 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
>
>
>

```

• Prev by Date: Re: best solution?
• Next by Date: Parallel programming.
• Previous by thread: Re: best solution?
• Next by thread: Re: best solution?