Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2001
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

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

Search the Archive

Re: assigning parameters from a matrix

  • To: mathgroup at smc.vnet.net
  • Subject: [mg27142] Re: [mg27067] assigning parameters from a matrix
  • From: Tomas Garza <tgarza01 at prodigy.net.mx>
  • Date: Wed, 7 Feb 2001 02:12:47 -0500 (EST)
  • References: <200102030959.EAA08538@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

I wonder if I got your problem all right. Let your matrix with the different
sets of parameters be mat:

In[1]:=
mat = {{1, 2, 3}, {3, 2, 1}, {3, 1, 2}, {2, 1, 3}}
Out[1]=
{{1, 2, 3}, {3, 2, 1}, {3, 1, 2}, {2, 1, 3}}

Define your function, say f, writing the 3 parameters in a list and the
other variables as usual. For example, suppose

In[2]:=
f[{a_, b_, c_}, x_, y_, z_] := a x + b y + c z

Then the following gives you all the combinations of parameter values into
your function:

In[3]:=
f[#] & /@ mat
Out[3]=
{x + 2 y + 3 z, 3 x + 2 y + z, 3 x + y + 2 z, 2 x + y + 3 z}

Tomas Garza
Mexico City

----- Original Message -----
From: "F cartwright" <flc at ualberta.ca>
To: mathgroup at smc.vnet.net
Subject: [mg27142] [mg27067] assigning parameters from a matrix


> Hi. I was hoping someone could help me.
>
> I have a function with 3 parameters, and I want to use a matrix to look at
> the shape of this function in response to specific combinations of the
> parameters (e.g., a = 1, b = 2, c = 3).  I have created a matrix with my
> different sets of parameters and have used the ReadList command to enter
> into Mathematica. What command(s) do I use to apply the function to the
> matrix and look at the different outcomes?  I am having repeated lack of
> success with Map.
>
> Please help!
>
>



  • Prev by Date: Re: Problem in loading own Package
  • Next by Date: Re: Problem in loading own Package
  • Previous by thread: assigning parameters from a matrix
  • Next by thread: Re: assigning parameters from a matrix