Services & Resources / Wolfram Forums
MathGroup Archive
*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
  • Subject: [mg27099] Re: assigning parameters from a matrix
  • From: Brian Higgins <bghiggins at>
  • Date: Sun, 4 Feb 2001 02:58:25 -0500 (EST)
  • References: <95glkt$>
  • Sender: owner-wri-mathgroup at

Here is one possibility (if I understand what you are trying to do
correctly). Let suppose your {a,b,c} data from your ReadList function
looks like this:

mydata = Table[{Random[], Random[], Random[]}, {4}]

{{0.964053, 0.729247, 0.867568}, {0.942935, 0.0860712, 0.588032},
{0.0714172,  0.65093, 0.890847}, {0.476312, 0.124108, 0.0936164}}

Now we convert the data into a set of rules:
myrules = Map[Thread[{a, b, c} -> #] &, mydata]

Here is our function

myfunc[x_] := c Sin[a x + b]

Then we apply our rules to the function

myfunc[x] /. myrules

{0.867568 Sin[0.729247 + 0.964053 x],
  0.588032 Sin[0.0860712 + 0.942935 x],
  0.890847 Sin[0.65093 + 0.0714172 x],
  0.0936164 Sin[0.124108 + 0.476312 x]}



In article <95glkt$8fg at>,
  "F cartwright" <flc at> wrote:
> 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
> different sets of parameters and have used the ReadList command to
> into Mathematica. What command(s) do I use to apply the function to
> matrix and look at the different outcomes?  I am having repeated lack
> success with Map.
> Please hel

Sent via

  • Prev by Date: Re: Raise lists of a list to powers
  • Next by Date: Re: Typesetting summation and product symbols
  • Previous by thread: Re: assigning parameters from a matrix
  • Next by thread: Export challenge