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: [mg27099] Re: assigning parameters from a matrix
  • From: Brian Higgins <bghiggins at ucdavis.edu>
  • Date: Sun, 4 Feb 2001 02:58:25 -0500 (EST)
  • References: <95glkt$8fg@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

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]}

Cheers,

Brian


In article <95glkt$8fg at smc.vnet.net>,
  "F cartwright" <flc at ualberta.ca> 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
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 hel


Sent via Deja.com
http://www.deja.com/


  • 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